Coffeehouse Thread

5 posts

Reading Zipped files in ASP.NET 3.5

Back to Forum: Coffeehouse
  • User profile image
    pavone

    Hey there, again.

    So now I'm trying to, if possible, read the content (file names) from a .zip file when somebody browses to a zipped file using my HTML file input. Is this possible without uploading the zipped file to the server (given I have a UNC path)? 

    To make it clearer, a use case would be a user come to my website, uses my html file input to browse to a zipped file, then clicks a html or asp.net button and my website outputs the names of all the files inside the zipped file (ideally without any upload). 

    Thanks.

  • User profile image
    blowdart

    The HTML file input control *always* uploads the file. Always.

  • User profile image
    kettch

    blowdart is right. The only way to do what you are after is to implement zip in JavaScript. Tongue Out

    I'm not even going to look, but I'm sure somebody has done it.

  • User profile image
    pavone

    , blowdart wrote

    The HTML file input control *always* uploads the file. Always.

    So then the HTML input control and a plain input control in a ASP.NET app are not the same? For example something like this:

    <input type="file" id="test"/>


    I have something like that and browsing to something does not (seem) to upload anything. Now if I create an asp.net input type, as soon as I browse to something it starts uploading. I had to implement the ICallbackEventHandler in the .cs file, but it seems to be doing what I need so far. 

    As for the zip reader, I wasn't aware javascript could give me what I want, still new to this. I was looking at System.IO.Packaging and thinking of hooking up more client controls to server side functions to do the trick...  Perplexed

     

  • User profile image
    blowdart

    , pavone wrote

    *snip*

    So then the HTML input control and a plain input control in a ASP.NET app are not the same? For example something like this:

    1
    <input type="file" id="test"/>


     

    It will once you submit the form. And because of the DOM security model you can't use client side javascript to get the path that appears in the input box either - you only end up with the filename.

     

Comments closed

Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation, please create a new thread in our Forums, or Contact Us and let us know.