I want to upload file to server using below code and i did file size upto 10 mb max....
but i have some problem that is ... time out and lost connection some body told me to use stream which open connection always but i dont have idea how to use it as i never did asp programming very well
is any body tell me where should i can get materail or any one just give me example to upload file to the server in effective way....
thanks
If Not File1.PostedFil e Is Nothing And File1.PostedFil e.ContentLength > 0 Then
Dim fn As String = System.IO.Path. GetFileName(Fil e1.PostedFile.F ileName)
Dim SaveLocation As String = Server.MapPath( "Data") & "\" & fn
Try
File1.PostedFil e.SaveAs(SaveLo cation)
Response.Write( "the file has been uploaded")
Catch ex As Exception
Response.Write( "Error" & ex.Message)
End Try
Else
Response.Write( "Please select a file to upload")
End If
but i have some problem that is ... time out and lost connection some body told me to use stream which open connection always but i dont have idea how to use it as i never did asp programming very well
is any body tell me where should i can get materail or any one just give me example to upload file to the server in effective way....
thanks
If Not File1.PostedFil e Is Nothing And File1.PostedFil e.ContentLength > 0 Then
Dim fn As String = System.IO.Path. GetFileName(Fil e1.PostedFile.F ileName)
Dim SaveLocation As String = Server.MapPath( "Data") & "\" & fn
Try
File1.PostedFil e.SaveAs(SaveLo cation)
Response.Write( "the file has been uploaded")
Catch ex As Exception
Response.Write( "Error" & ex.Message)
End Try
Else
Response.Write( "Please select a file to upload")
End If