Uploading entire directory

  • Thread starter Thread starter VB Programmer
  • Start date Start date
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
 
The entire Directory!!!!
Can't u let it create a directory before uploading files or just ove files?
 
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
 
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.
 
Back
Top