New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor multiform upload to better implementation and handle uploading large file. this will fix #24, #25, #27 #31
Conversation
@onikiri2007 - Before going into much detail: Have you considered depending on Alamofire instead of copying the code in? We can always strip out unused components on a release build, therefore I don't think package size is a major concern at the moment. Also, good to not copy a requested file twice (in the example), and let the form builder be standardised. Will the Alamofire uploader make a copy of the request and store it in cache, though? |
|
OK, so it's only a code cleanup for the form data builder, sounds good! |
first one is done. Alamofire is now dependency. I might refactor the Urlsession part also later to use Alamofire's sessionManager instead. for now this will be first refactoring. |
@onikiri2007 , ok - just two things left from my point of view:
We'll do SwiftLint on CI in the future as well. |
clean up is done |
@onikiri2007 please rebase |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. As mentioned we will add the Swift linter next.
Current multipart form upload implementation has the potential to run out of memory when uploading large files since it loads the whole file into memory and writes to the request file.
this PR will attempt to fix that. code has been copied from Alamofire. their multiplatform data has a better implementation.
Refactor example app to send the direct video/image path instead of copying and let the platform take care of the rest.
This should fix with issue #24, #25, #27