Closed cgarciae closed 9 years ago
Thanks! Now Redstone accepts the request. However I get a map like this
{ 'file' : 'data:image/jpeg;base64,/9j/4AAQSkZJRgABAgAAAQAB...'}
I've seen that if I manually use an input form (which I don't because then the browser tries to navigate to /upload
) Redstone decodes the file to a HttpBodyFileUpload
automatically. What can I add on the client upload to achieve the same effect?
My new client code looks like this
dom.FormData formData = new dom.FormData();
formData.append('file', data);
return dom.HttpRequest.request (path, method: "POST",
sendData: formData);
Try to apeend the file input element to the form, instead of the file data.
Thanks! It worked sending the FormElement
and nowI have file
is a HttpBodyFileUpload
.
One last bit of help, I am guessing HttpBodyFileUpload.content
is a binary representation of the image since its a List<int>
, how can I convert and save this to disk as a png
for example?
Thanks a lot!
I am trying to upload a file in Dart with this code
Reading the file
Sending the file
But I get this error
I receive it in Redstone like this
I am doing something wrong on the client or on the server?