Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
2.6k views
in .NET FTP by (140 points)
I am trying to upload a picture to an FTP an no errors are being thrown but the image is not being saved. It works when I run it on my local machine but when it is being run from the webserver it does not work.


This is the code that I am using. I don't understand why it works when using my local machines connection but fails when I use the webserver connection.

ftp = New FTPClient(host)

ftp.Login(user, password)
ftp.ConnectMode = FTPConnectMode.PASV
ftp.TransferType = FTPTransferType.BINARY
ftp.ChDir("images")
ftp.Put(sFile, sFile2)
ftp.Quit()

1 Answer

0 votes
by (162k points)
1. Post the log file

2. What does "when it is being run from the webserver" mean? Where are you FTP'ing from and to?

I am trying to upload a picture to an FTP an no errors are being thrown but the image is not being saved. It works when I run it on my local machine but when it is being run from the webserver it does not work.


This is the code that I am using. I don't understand why it works when using my local machines connection but fails when I use the webserver connection.

ftp = New FTPClient(host)

ftp.Login(user, password)
ftp.ConnectMode = FTPConnectMode.PASV
ftp.TransferType = FTPTransferType.BINARY
ftp.ChDir("images")
ftp.Put(sFile, sFile2)
ftp.Quit()

Categories

...