0

Using the below code to upload file to my FTP location but I am getting the below error.

I checked the FTP Location / username and password with FileZilla and everything is working fine and also I can able to create file manually in Filezilla. So there is no rights issue I believe.

The remote server returned an error: (550) File unavailable (e.g., file not found, no access)

Sub FTPFileUpload()
    Dim sFTPSaveLoc As String, sLocalSysFilePath As String

    sLocalSysFilePath = "D:/9100.txt"
    sFTPSaveLoc = "ftp://MyFTPIPAddressHere/ftp/DB/9100.txt"

    My.Computer.Network.UploadFile(sLocalSysFilePath, sFTPSaveLoc, "FTPUserIDHere", "FTPPasswordHere")

End Sub

Any suggestion will be highly helpful.

Sixthsense
  • 1,927
  • 2
  • 16
  • 38
  • 1
    Does the directory `/ftp/DB` exist? Ensure you have write permissions to it as well. – Visual Vincent Dec 20 '18 at 06:23
  • Yes exists and I can able to create file manually in /ftp/DB folder using filezilla but I can't get it work with the above code. Whether the above code is working for you? – Sixthsense Dec 20 '18 at 06:26
  • Sorry, but I am currently in no position to test it. I found this, though. It's worth a shot: https://stackoverflow.com/a/27487095 – Visual Vincent Dec 20 '18 at 06:32
  • Thank you.... You fixed it.... The /ftp/ is a shared folder which I should not use when using the FTP path. I removed it and its working fine now. Please post your suggestion as Answer I will mark it as answer. – Sixthsense Dec 20 '18 at 06:32
  • When I see it in filezilla it doesn't show /ftp/ in the directory listing. So your reply given me clue that I am unnecessarily using the /ftp/ in the FTP location connection string. Thanks once again. – Sixthsense Dec 20 '18 at 06:34
  • Glad I could help, but I barely suggested anything :). Since it was caused by a typo I'm just going to vote to close it as such instead. – Visual Vincent Dec 20 '18 at 06:34

0 Answers0