Uploading a directory instead of a file

  • Thread starter Thread starter K Viltersten
  • Start date Start date
K

K Viltersten

If i go as follows:

<asp:FileUpload ID="dirTemp" runat="server" Width="400px" /><br />

The element i create is requiring me to select a file. Can i use this
control to point out a directory? Is there another one?
 
Not really - as it needs to render at the client via html; there is an
<input type="file" ...>, but nothing similar for folders. If you are
happy to use client-side controls (OCX, or possibly silverlight etc) you
might be able to do more (look at sharepoint's "upload multiple" for
example) - but otherwise it depends on the user - for example, are they
savvy enough to zip a folder and upload the zip? It depends on the user:
a developer is probably fine with this; a visitor to "Ma's bake
sale.org" - probably not.

Marc
 
Not really - as it needs to render at the
client via html; there is an
<input type="file" ...>
but nothing similar for folders. If you
are happy to use client-side controls
(OCX, or possibly silverlight etc) you
might be able to do more...

Unfortunately i'm not at such liberty. It
strikes me as awfully strange that such a
facility hasn't been implemented, though...
 
1: User chooses directory they wish to upload.
2: Create directory on the server.
3: Recurse through all the files in the directory on the user-end
4: For each file, upload.

This would be in the code-behind of course.


If i go as follows:

<asp:FileUpload ID="dirTemp" runat="server" Width="400px" /><br />

The element i create is requiring me to select a file. Can i use this
control to point out a directory? Is there another one?
 
1: User chooses directory they wish to upload.
2: Create directory on the server.
3: Recurse through all the files in the directory on the user-end
4: For each file, upload.

This would be in the code-behind of course.


If i go as follows:

<asp:FileUpload ID="dirTemp" runat="server" Width="400px" /><br />

The element i create is requiring me to select a file. Can i use this
control to point out a directory? Is there another one?

Does JS let you "3: Recurse through all the files in the directory on
the user-end "???
 
1: User chooses directory they wish to upload.
2: Create directory on the server.
3: Recurse through all the files in the
directory on the user-end
4: For each file, upload.

This would be in the code-behind of course.

Good scheme but how would one do item 1? The
only way to select the directory i've found
this far is to type it in into a text box.
That method will be very error prone...
 
1: User chooses directory they wish to upload.
Granted, you're asking an ASP question in a general C# newsgroup, so
this might not apply to you. But there's the FolderBrowserDialog class.

Hehe, this is awkward... I _THOUGHT_ it was an ASP.NET group. :)

It must be the switch of my news client, i geuss... You info was, as you
very accurately anticipated, not of much use in my case. But that's my
fault, of course. Sorry for that and thanks!

Konrad Viltersten
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top