Click here to Skip to main content
15,881,248 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I wrote following code below:
Try
VB
Dim createFTP As String = Convert.ToString(host & Convert.ToString("/")) & remoteFile
' Create an FTP Request 
ftpRequest = DirectCast(FtpWebRequest.Create(createFTP), FtpWebRequest)

' Log in to the FTP Server with the User Name and Password Provided 
ftpRequest.Credentials = New NetworkCredential(user, pass)
'ftpRequest.Credentials = New NetworkCredential(user, pass, createFTP)

' When in doubt, use these options 
ftpRequest.UseBinary = True
ftpRequest.UsePassive = True
ftpRequest.KeepAlive = True

' Specify the Type of FTP Request 
ftpRequest.Method = WebRequestMethods.Ftp.UploadFile

' Establish Return Communication with the FTP Server 
ftpRequest.Timeout = 600000
ftpRequest.ReadWriteTimeout = 600000

' read in file...
Dim bFile() As Byte = System.IO.File.ReadAllBytes(localFile)

'  ftpStream = ftpRequest.GetRequestStream()
' Open a File Stream to Read the File for Upload 
Dim clsStream As System.IO.Stream = ftpRequest.GetRequestStream()
clsStream.Write(bFile, 0, bFile.Length)
clsStream.Close()
clsStream.Dispose()

ftpRequest = Nothing
Catch ex As WebException
  MsgBox(ex.ToString())
End Try


But not working properly & generate the error no 553 in ftp server.
How can i solve it..
Please help me .

Thanks in advance.
Posted
Updated 16-Feb-15 2:17am
v3
Comments
ZurdoDev 16-Feb-15 8:15am    
I believe 553 is a permission denied error.

1 solution

FTP error 553 is about permission. So if you got that error it means that the supplied credentials are not valid to access the FTP. You should check your FTP for proper user credentials, fix that issue and than check your code...
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900