constantine-fry / rebekka

Rebekka - FTP/FTPS client in Swift.
BSD 2-Clause "Simplified" License
87 stars 56 forks source link

Fixed mapFTPResources key type, added download file destination param #3

Closed androidrivne closed 8 years ago

androidrivne commented 8 years ago

Fixed mapFTPResources key type, added download file destination param
 Fixed resource size fetching

constantine-fry commented 8 years ago

Hm, why don't you like the default behaviour: it downloads file into tmp directory and you move into you destination folder by yourself. There can be a problem with custom 'destination' path: who should delete file if app crashes during downloading? If you use default tmp directory it's gonna be cleaned automatically.

androidrivne commented 8 years ago

It's good idea to clean files from tmp folder, but what about time needed to move files to another directory (can be many files with folders) ?

constantine-fry commented 8 years ago

Hm, I don't you gonna have significant performance issues with file moving. I copied the behaviour for NSURLSession, which puts downloaded file into 'tmp' directory. https://developer.apple.com/library/ios/documentation/Foundation/Reference/NSURLSessionDownloadTask_class/index.html#//apple_ref/occ/cl/NSURLSessionDownloadTask

I thought one more time, but I would like to keep the existing behaviour. So I'm gonna close your PR, but thanks in any case :)

androidrivne commented 8 years ago

Ok :) How about "Fixed mapFTPResources key type" and "Fixed resource size fetching" is that fixes ok ?

Also we are facing problem of downloading large zip file (50mb - 200mb) - it just stops download (method @objc func stream(aStream: NSStream, handleEvent eventCode: NSStreamEvent) doesn't call) but when we make http request (load url in webview) it resumes downloading

constantine-fry commented 8 years ago

Thank you for reporting bugs. I have fixed 'resource size fetching' and file downloading. I'm sorry, I have fixed the problem with fetching size while debugging downloading. You may try latest commit on master branch.

Let me know if something is still wrong.

androidrivne commented 8 years ago

Cool, it works, thanks