S
Simon
I'm following microsoft's guide on how to upload files. I want to upload
AND rename the file... Anyone have some tips for how to do that? Thanks
---[vb.net code]---
If Not File1.PostedFile Is Nothing And File1.PostedFile.ContentLength > 0
Then
Dim fn As String =
System.IO.Path.GetFileName(File1.PostedFile.FileName)
Dim SaveLocation As String = Server.MapPath("Data") & "\" & fn
Try
File1.PostedFile.SaveAs(SaveLocation)
Response.Write("The file has been uploaded.")
Catch Exc As Exception
Response.Write("Error: " & Exc.Message)
End Try
Else
Response.Write("Please select a file to upload.")
End If
End Sub
AND rename the file... Anyone have some tips for how to do that? Thanks
---[vb.net code]---
If Not File1.PostedFile Is Nothing And File1.PostedFile.ContentLength > 0
Then
Dim fn As String =
System.IO.Path.GetFileName(File1.PostedFile.FileName)
Dim SaveLocation As String = Server.MapPath("Data") & "\" & fn
Try
File1.PostedFile.SaveAs(SaveLocation)
Response.Write("The file has been uploaded.")
Catch Exc As Exception
Response.Write("Error: " & Exc.Message)
End Try
Else
Response.Write("Please select a file to upload.")
End If
End Sub