471,328 Members | 1,915 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,328 software developers and data experts.

Uploading a directory instead of a file

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?

--
Konrad Viltersten
Jun 27 '08 #1
8 1121
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
Jun 27 '08 #2
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...

--
Regards
Konrad Viltersten
--------------------------------
sleep - a substitute for coffee for the poor
ambition - lack of sense to be lazy

Jun 27 '08 #3
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.
"K Viltersten" <tm**@viltersten.comwrote in message
news:op***************@lp028.pagero.local...
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?

--
Konrad Viltersten

Jun 27 '08 #4
On May 6, 3:25 pm, "Lucid" <lu...@phreak2000.comwrote:
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.

"K Viltersten" <t...@viltersten.comwrote in message

news:op***************@lp028.pagero.local...
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?

--
Konrad Viltersten
Does JS let you "3: Recurse through all the files in the directory on
the user-end "???
Jun 27 '08 #5
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...

--
Regards
Konrad Viltersten
--------------------------------
sleep - a substitute for coffee for the poor
ambition - lack of sense to be lazy

Jun 27 '08 #6
On Tue, 06 May 2008 21:17:32 -0700, K Viltersten <tm**@viltersten.com>
wrote:
>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?
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.

Pete
Jun 27 '08 #7
>>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?

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
Jun 27 '08 #8
On Wed, 07 May 2008 00:00:26 -0700, K Viltersten <tm**@viltersten.com>
wrote:
Hehe, this is awkward... I _THOUGHT_ it was an ASP.NET group. :)
Not a hard mistake to make, as there are a few ASP.NET experts (well, they
seem expert to me anyway :) ) who do answer ASP questions here.

But, glad to help redirect you...I hope you get a better answer from the
correct newsgroup. :) I would hope that, assuming there's any sort of
common file dialog support at all in ASP.NET, they'd include an equivalent
to the folder browser dialog.

Pete
Jun 27 '08 #9

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by dickiedyce | last post: by
9 posts views Thread by R. Rajesh Jeba Anbiah | last post: by
1 post views Thread by Jason Gleason | last post: by
4 posts views Thread by VB Programmer | last post: by
5 posts views Thread by Chris | last post: by
4 posts views Thread by Mukesh | last post: by
1 post views Thread by ali | last post: by
8 posts views Thread by K Viltersten | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.