Uploading entire directory

V

VB Programmer

I know how to upload an individual file to a server (See below code
snippet).

QUESTION: Is there an easy way to upload an entire subdirectory and all
it's files? Or, do I have to loop thru the dir and upload them 1 by 1?

This is the way I'm uploading the file...

Dim strFileName As String
strFileName = MyFile.PostedFile.FileName
Dim c As String = System.IO.Path.GetFileName(strFileName) ' only the
attched file name not its path

' Let us Save uploaded file to server
Try
MyFile.PostedFile.SaveAs(ConfigurationSettings.AppSettings("NewsletterFileDir")
+ c)
Span1.InnerHtml = "Your File Uploaded Sucessfully: " &
ConfigurationSettings.AppSettings("NewsletterFileDir") & c
Catch Exp As Exception
Span1.InnerHtml = "An Error occured. Please check the attached
file"
End Try
 
G

Guest

The entire Directory!!!!
Can't u let it create a directory before uploading files or just ove files?
 
S

Steve C. Orr [MVP, MCSD]

V

VB Programmer

Orr for President. Thanks.

Steve C. Orr said:
The standard File control allows only one file to be specified for upload.
If you need to upload 2 files, then the simplest solution is to have 2
File controls on the page.
There are fancier options, but they generally require thick clients. Here
are some 3rd party options that may help you out:
http://fileup.softartisans.com/fileup-231.aspx
http://fileup.softartisans.com/fileup-131.aspx

More info:
http://SteveOrr.net/articles/EasyUploads.aspx
 
G

gabe garza

Within a FORM tag you can specify several INPUT tags of type=FILE to upload
several files but the user must select each of the files to upload.

Yes HTML specifications has limitations (for good reasons) but if you really
need to go outside of the HTML specification write a Windows Application not
a Web Based Application..
Don't compromise security. Every developer has good intentions but hackers
don't. Think like a hacker to write better secured web applications or to
decided whether a Web Based application is what you should be developing.
 

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

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,015
Latest member
AmbrosePal

Latest Threads

Top