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
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