I need help on this issue ASAP. I am trying to download a file from my UNIX FTP Server by using Aspose.Network. Before I start downloading file I am trying to get the size of the file by using GetFileSize function. But, it throws an exception with message: Failed to get file size! The stack trace does not give any hint why is that happening. First I thought it might be a connection problem, and then I commented this line and it downloads the file with no problem. So it has to be something wrong in this function. Can someone from Aspose team take a look on this, Please! Thanks very much. Here is the stack trace of the exception:
Aspose.Network.Ftp.FtpException: Failed to get file size :550 SIZE: Operation not permitted
at Aspose.Network.Ftp.FtpClient.GetFileSize(String remoteFilePath)
at FTPDownloadAndDelete.FTP.DownloadFTPFile() in myproject.vb:line 218
By the way, it works fine with Windows 2003 FTP server, it throws this exception ONLY on UNIX FTP server
Thanks for the reply, I have the latest version of Aspose.Network (version 3.5.2.0) which is the most recent one on the website. And I verified that the GetFileSize function works fine with windows FTP servers and throws the exception if try to get file size on UNIX FTP servers. So, its gotta be a bug in that function. Please increase the priority of this issue, because we are trying to push our application’s next release ASAP. I appreciate your understanding into this matter. Thanks very much.
By the way, the link and the latest version you provided is for Aspose.Barcode.
Could you please tell me what UNIX ftp server are you using? Is it possible to provide an account for our debugging? My mailbox is guangzhou$$aspose.com. If you can provide us a ftp account for debugging, send it to my email.
In addition, could you please try to use the follow code to see if it works? We have resolved some bugs relative to GetSize in Unix. I know whether it can help or not.
string ftpServer = @"ftp1.at.proftpd.org"; FtpClient client = new FtpClient(ftpServer); client.Connect(true); client.ResetTransferType(TransferType.Binary); long size = client.GetFileSize(@"memtest86.img"); Console.WriteLine(size);
Thanks for the reply. I have asked our service provider about the UNIX FTP question you had, and they gonna get back to me some time later today, I will update you with the information about what type of server it is, later today.
I have opened an account so that you can troubleshoot the problem and debug into it. I am gonna send it to your email, once you done please let me know so that I can close the account.
I am using the exact same function you said to see if works. Here is the VB.NET code that I am using:
Dim WithEvents moFTP As New FtpClient
'Connect to FTP server!
Me.moFTP = New FtpClient("ServerName", "UserName", "Password")
Me.moFTP.TransferType = TransferType.Binary
moFTP.Connect(True)
'Make sure that the file exists on FTP server!
If Not Me.moFTP.Exists(RemotePath) Then
Me.moFTP.Disconnect()
Exit Sub
End If
'Get the File Size -> THIS LINE THROWS EXCEPTION
Dim miRemoteFileSize As Long = Me.moFTP.GetFileSize(RemotePath)
'Download the File
Me.moFTP.Download(sRemotePath, sLocalPath, True)
'Disconnect from FTP Server!
Me.moFTP.Disconnect()
Again, thanks very much for your help, I look forward to see it working! Thanks.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.