bruce
03-22-2007, 06:47 AM
what is the error?
Bruce
DiscountASP.NET
www.DiscountASP.NET (http://www.DiscountASP.NET)
mauro_zovi
03-22-2007, 07:34 AM
Hi. I use this subroutine to upload some .pdf (30Kb each), but after upload a few (150-200) i got an error. Is this connected with our hosting? How can i solve the problem? Thanks.
Private Sub Upload(ByVal source As String, ByVal target As String, ByVal credential As NetworkCredential)
Dim request As FtpWebRequest = _
DirectCast(WebRequest.Create(target), FtpWebRequest)
request.Method = WebRequestMethods.Ftp.UploadFile
request.Credentials = credential
Dim reader As New FileStream(source, FileMode.Open)
Dim buffer(Convert.ToInt32(reader.Length - 1)) As Byte
reader.Read(buffer, 0, buffer.Length)
reader.Close()
request.ContentLength = buffer.Length
Dim stream As Stream = request.GetRequestStream
stream.Write(buffer, 0, buffer.Length)
stream.Close()
Dim response As FtpWebResponse = DirectCast(request.GetResponse, FtpWebResponse)
'MessageBox.Show(response.StatusDescription, "File Uploaded")
response.Close()
End Sub
vvsharma
03-22-2007, 08:53 AM
Could be several reasons,space,firewall etc. Please post the exact error message.
Vikram
DiscountASP.NET
www.DiscountASP.NET (http://www.discountasp.net/)
vBulletin® ©Jelsoft Enterprises Ltd.