Our Products:   CompleteFTP  edtFTPnet/Free  edtFTPnet/PRO  edtFTPj/Free  edtFTPj/PRO
0 votes
4.9k views
in .NET FTP by (540 points)
I want to transfert a big file more than 14 Mb, but there are a probleme i can not send this file, i have a message like

The filename, directory name, or volume label syntax is incorrect. (code=550)


to the line :

ftpConnect.UploadFile(ConfigurationSettings.AppSettings["UploadPath"] + chemin, chemin);
Avez vous d

8 Answers

0 votes
by (51.6k points)
Make sure the path of the remote file is not in Windows format, i.e. it should not have a drive specification (e.g. "C:") and it should use forward-slashes (i.e. "/") instead of back-slashes (i.e. "\"). Also, paths are usually given with respect to the "home directory" of the FTP account on the server. This is different from the absolute path on the server.

For example, if home directory of a user account on a Windows-based FTP server is "C:\myftpserver\home\myusername" and the file you want is "C:\myftpserver\home\myusername\mydir\myfile.dat", then the path that you should use would be "mydir/myfile.dat".

You might find it helpful to use a GUI FTP client like FileZilla to familiarize yourself with how file paths are specified in FTP.

- Hans (EDT)
0 votes
by (540 points)
Yes I'm sure that is correct because when the file has a size of 1Mb, he is upload, but when the size is 14Mb, he can not upload it!
0 votes
by (51.6k points)
OK, can you please enable logging and post the relevant part of the log that demonstrates the problem.

- Hans (EDT)
0 votes
by (540 points)
This is the code in C#:
                    FUFile.SaveAs(ConfigurationSettings.AppSettings["UploadPath"] + FUFile.FileName);
                    
                    #region ftp

                    FTPConnection ftpConnect = new FTPConnection();
                    ftpConnect.AutoLogin = true;
                    ftpConnect.Password = ConfigurationSettings.AppSettings["ftpPwd"];
                    ftpConnect.UserName = ConfigurationSettings.AppSettings["ftpUser"];
                    ftpConnect.ServerAddress = ConfigurationSettings.AppSettings["ftpAdresseServer"];
                    ftpConnect.ServerPort =Convert.ToInt32(ConfigurationSettings.AppSettings["ftpPortServer"]);
                    ftpConnect.Timeout = 99999999;
                    ftpConnect.TransferBufferSize = 999999999;
                    ftpConnect.Connect();
                    ftpConnect.ChangeWorkingDirectory(ConfigurationSettings.AppSettings["ftpUploadAdresse"]);
                    ftpConnect.UploadFile(ConfigurationSettings.AppSettings["UploadPath"] + chemin, chemin);

                    ftpConnect.Close();
                    #endregion


This is in my web.config:
      <add key="ftpPwd" value="anon@"/>
      <add key="ftpUser" value="anonymous"/>
      <add key="ftpAdresseServer" value="10.0.0.32"/>
      <add key="ftpPortServer" value="21"/>
      <add key="ftpUploadAdresse" value="/FTPTest"/>


and this my error:
guide du d?veloppeur DELPHI.pdf: The filename, directory name, or volume label syntax is incorrect. (code=550)
0 votes
by (51.6k points)
  • Setting TransferBufferSize to 999999999 is a really bad idea. Better to leave it as the default.
  • There's no need to set the Timeout to such a large value either. The default is 0, meaning that it doesn't time out, which is probably what you want.
  • If the file-name really is guide du d?veloppeur DELPHI.pdf then that's probably your problem. I don't think *nix file systems allow question-marks in file-names since that is a wild-card character. Try renaming the file and then transferring it again. Also, try to transfer the file using a standalone FTP client application.


You did not include the log. If you still have problems, please have a look in the Developer's Guide to find out how to enable logging and post the relevant portion of the log.

- Hans (EDT)
0 votes
by (540 points)
Thanks, but nox i'have a new probleme certainly in cause about the size:

Une exception de type 'System.OutOfMemoryException' a
0 votes
by (51.6k points)
Did you remove your TransferBufferSize setting? In other words, please remove the line:
ftpConnect.TransferBufferSize = 999999999;


If you don't do this then it'll read the whole file into memory before beginning to send it.

- Hans (EDT)
0 votes
by (540 points)
yes thanks, it's good now

Categories

...