You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In particular, we should clarify that StreamedRequest is not the preferred solution for file uploads in the browser. Instead, the file should be sent directly or via a FormData/MultiPart request so that the browser can handle streaming the file for us.
The StreamedRequest isn't as useful in the browser due to it being implemented with XHR, which doesn't give us the ability to manually stream data. Because of this, the StreamedRequest implementation actually waits for the stream to complete and sends the entire payload as Uint8List (https://github.com/Workiva/w_transport/blob/master/lib/src/http/browser/request_mixin.dart#L112-L114)
Obviously we still want to be able to upload large payloads (like files) without loading it all into memory, but for security reasons, the browser has to do this for us. In this particular scenario, the way to do this is to send the file directly or in a FormData/MultiPart request so that the browser can handle the streaming for us. This works because these types of requests don't actually load the file into memory, they just have a pointer to the file location that the browser understands, whereas the StreamedRequest doesn't know this and actually reads the file.
The text was updated successfully, but these errors were encountered:
It looks like you have not included any tickets in the title of this issue. Please create a ticket for this issue, or click here to have Rosie create one for you.
evanweible-wf
changed the title
Provide FileUpload guides/best practices
Provide file upload guides/best practices
Sep 6, 2016
rm-astro-wf
changed the title
Provide file upload guides/best practices
CP-2600 Provide file upload guides/best practices
Sep 6, 2016
rmconsole3-wf
changed the title
CP-2600 Provide file upload guides/best practices
WP-4242 CP-2600 Provide file upload guides/best practices
May 24, 2017
In particular, we should clarify that
StreamedRequest
is not the preferred solution for file uploads in the browser. Instead, the file should be sent directly or via a FormData/MultiPart request so that the browser can handle streaming the file for us.The text was updated successfully, but these errors were encountered: