Ok this code works if save location is server.mapPath but as you can see
i want to save on a different location the error is
"Error: URI formats are not supported" not sure where i am going wrong any ideas?
i want to save on a different location the error is
"Error: URI formats are not supported" not sure where i am going wrong any ideas?
VB.NET:
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
Dim SaveLocation As String = "http:\\maca\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
Last edited by a moderator: