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
Stream not correct work for video/image
I use project VaporUploads-main.zip
When I send file type pdf it work correct? and I can open it, but when I send other type of file it send, but I can't open it because
image file I download from internet
The text was updated successfully, but these errors were encountered:
There's nothing wrong with Vapor or your project, but the way you upload the image is not compatible with the code. The route expects a HTTP POST request whose body is the image data directly, not part of a multipart form.
Opening the image file in a hex editor quickly reveals the issue. Notice the highlighted area: that's the header from a multipart file upload, which was saved into the image file directly.
If I delete this, and the footer area at the end, the image opens up fine (although there don't seem to be any rabbits on it).
Now, how to do multipart uploads without loading the complete body into memory is an interesting challenge for which I don't have an answer. Maybe someone else will.
Stream not correct work for video/image
I use project
VaporUploads-main.zip
When I send file type pdf it work correct? and I can open it, but when I send other type of file it send, but I can't open it because
image file I download from internet
The text was updated successfully, but these errors were encountered: