-
Notifications
You must be signed in to change notification settings - Fork 134
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
Flash runtime does not write an extra CR/LF to end of the multipart request #37
Comments
I'm afraid this is a problem with default upload method in Flash. We do not have any control over it. But we have another, artificial mode, where we build multipart request ourselves and the result gets consistent across the runtimes. You can forcefully switch to it by explicitly requesting However it is only applicable to files smaller than 200-300mb, since this method requires the file to be preloaded first. It is a case specific to Flash only. Are you using this component as a part of Plupload, or you are building directly on top of it? I can provide better example, if you post more details about your usage case. |
Thanks for the update @jayarjo! :) My use case is that I am using the Plupload custom upload feature to allow users to upload log files which normally range in the 1-2 GB range. For the server-side, I'm running ASP.NET on IIS using the new Web API framework. My initial set up of Plupload is this: var uploader = new plupload.Uploader({
browse_button: 'add-file',
flash_swf_url: '/Scripts/Moxie.swf',
max_file_size: '2gb',
max_retries: 3,
multi_selection: true,
runtimes: 'html5,flash,silverlight',
silverlight_xap_url: '/Scripts/Moxie.xap',
url: '/api/upload'
});
uploader.init();
// all events are bound here (i.e. FilesAdded, UploadProgress, Error, etc). My initial idea was to just upload the entire file, but once I have that working I would add chunking and resumable upload support. Would splitting the 2gb file into 200-300mb chucks help? To give you an idea on our usage: with our old system we currently have up to 10-15 total simultaneous uploads across all users at any given time. We could see an increase in that with this new implementation, but it should support at least that. Thanks for the help! EDIT: I changed the description to mention that Microsoft will probably not fix the issue on their end. |
It doesn't look like Adobe will fix it either. I'd probably recommend to simply ignore the Flash runtime the (1-2gb is too much), chunking will not help, since it still requires the file to be preloaded in memory (only in the case of Flash). Anyway this is how you can force it to our artificial multipart mode: var uploader = new plupload.Uploader({
browse_button: 'add-file',
flash_swf_url: '/Scripts/Moxie.swf',
max_file_size: '2gb',
max_retries: 3,
multi_selection: true,
runtimes: 'html5,flash,silverlight',
silverlight_xap_url: '/Scripts/Moxie.xap',
url: '/api/upload',
required_features: 'send_binary_string'
}); |
I'm attempting to use plupload 2.0 to upload files to a .NET WebAPI server and there is an issue with the Flash runtime not writing an extra CR/LF to end the multipart request. Technically, it's not required, but the .NET WebAPI runtime breaks if the request does not end with a CR/LF (see this issue and this discussion on CodePlex). It doesn't look like they are not going to fix the problem on their end either. 👎
The following is an example request sent from the Flash runtime:
And here is the request using the HTML5 runtime:
Both the HTML5 and Silverlight runtimes give that extra CR/LF at the end of the request. Can the Flash runtime be changed to output it as well?
Thanks!
The text was updated successfully, but these errors were encountered: