Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
272 views
in .NET FTP by (170 points)

I calling command

secureFTPConnection1.UploadFile(m_upload, m_name);

Where m_upload is the directory and m_name is the name of the file.

and I receive the error;

EnterpriseDT.Net.Ftp.FTPException
  HResult=0x80131600
  Message=Failed to open file 'C:\\AutoFiles\\AutoTemp\\AutoTemp'
  Source=edtFTPnetPRO
StackTrace:
   at EnterpriseDT.Net.Ftp.Ssh.SSHFTPClient.Put(String local, String remote, Boolean append)
   at EnterpriseDT.Net.Ftp.FTPConnection.UploadFile(String localPath, String remoteFile, WriteMode writeMode)
   at EnterpriseDT.Net.Ftp.ExFTPConnection.SyncUploadFile(String localPath, String remoteFile, WriteMode writeMode)
   at EnterpriseDT.Net.Ftp.ExFTPConnection.UploadFile(String localPath, String remoteFile, Boolean append)
   at EnterpriseDT.Net.Ftp.FTPConnection.UploadFile(String localPath, String remoteFile)

2 Answers

0 votes
by (51.5k points)

Please verify that the account under which your process is executing has read permission for the file, C:\AutoFiles\AutoTemp\AutoTemp. Actually, the file-name is a little odd, so you might also like to confirm that this is actually a file that exists.

0 votes
by (170 points)

I found that the m_upload needs to include the name of the file in the path. Like " C:\AutoFiles\AutoTemp\AutoTemp\file_name.txt".  Then the m_name needs to be equal to the file name, "file_name.txt" in my example. Seems redundant, but that's the way it is. This fixed my problem.

by (162k points)
It's not redundant, because users often want to upload a file under a different name. It's common, for example, to upload it as a temporary file and rename it afterwards.
by (170 points)
Thanks, that makes total sense!

Categories

...