EldoS | Feel safer!

Software components for data protection, secure storage and transfer

FTPS Client sample for WinRT - Download size 0

Also by EldoS: RawDisk
Access locked and protected files in Windows, read and write disks and partitions and more.
Posted: 04/14/2013 08:24:49
by Tomasz Wiśniewski (Basic support level)
Joined: 04/14/2013
Posts: 3

I was trying out your ftp library for WinRT. I started SimpleFTPS sample, connected to my server(without SSL/TLS) and tried to download something. Log says everything is ok, but downloaded file has size 0. I tried in active and passive mode, with and without firewall. In Total Commander(desktop) it works fine. Do you have any ideas what could be the problem?
Posted: 04/14/2013 11:42:15
by Eugene Mayevski (Team)

Thank you for the report.

Can you please post the log here? Maybe something was in fact not exactly OK.

Sincerely yours
Eugene Mayevski
Posted: 04/15/2013 06:15:50
by Tomasz Wiśniewski (Basic support level)
Joined: 04/14/2013
Posts: 3

Thanks for the fast reply. I attached my log. I also added English translation in brackets {}.

[ Download ]
Posted: 04/15/2013 06:20:39
by Eugene Mayevski (Team)

Thank you for the log. It looks perfectly valid and the only idea I have is that maybe the file could not be written for some reason OR that it was not closed (i.e. you've inspected it while it was still opened by the application). I am inclined to the second variant.

What you can do is use DownloadStream() method (either modify the sample or use it in your code) and inspect stream length after calling the method.

May I ask you to check desktop FTPSClient sample as well on this exact server? If it fails, it will be to some extent easier to diagnose the problem.

Sincerely yours
Eugene Mayevski
Posted: 04/15/2013 08:09:23
by Tomasz Wiśniewski (Basic support level)
Joined: 04/14/2013
Posts: 3

Ok, I managed to solve it thanks to your advice.

Desktop FTPSClient is working fine.
I used DownloadStream() method, all the data was transfered. There was a problem with saving file. I saved all the data from OnBinaryData event to byte array and then saved it with this method:

await Windows.Storage.FileIO.WriteBytesAsync(myStorageFile, myByteArray);

It works this way.

After doing that I noticed that it was working fine all the time actually... File just didn't save where I chose in picker. Instead it was saved in local folder of the app and in location chose in picker only empty file was created. When I looked at the code responsible for this it's pretty obvious, but I didn't expect such behavior. I don't know whether is intentional or not?

Thanks for your time and help.
Also by EldoS: CallbackFilter
A component to monitor and control disk activity, track file and directory operations (create, read, write, rename etc.), alter file data, encrypt files, create virtual files.



Topic viewed 1629 times

Number of guests: 1, registered members: 0, in total hidden: 0


Back to top

As of July 15, 2016 EldoS business operates as a division of /n software, inc. For more information, please read the announcement.

Got it!