Closed chstrong closed 5 years ago
@chstrong How are you sending the form? The browser or the client should send it as binary field in multipart body.
@tejainece The form sending and upload through multipart is working.
If I want to view the video however through localhost:8005/media/video.mp4 it isn't loading, or it starts to display the binary representation of the video, instead of the content. Pictures do work though.
I mean this line, which makes Jaguar serve the static files in the directory. Images work, videos don't, and PDF's seem to have the same issue. server.staticFiles('/media/*', Directory('bin/data'));
Ok. Got it!
Can you do me a favor? Let me know what is the mimetype
you see for the response at the client?
I will add video mimetypes to here: https://github.com/Jaguar-dart/jaguar/blob/05398b87040c1d9322733d82fead51291dbcc7f1/jaguar/lib/http/common/mimetype.dart#L43
Thanks a lot, this works perfectly now. If I have some other exotic mime types, how would I add them?
Something like server.staticFiles().mimeTypes.add() would be cool, to specify a list of custom mime types for static files. Is there something similar to this built-in already?
One could use responseProcessor
.
The static files part of Jaguar seems to have an issue with larger files or maybe unsupported content types. When I try to load a picture, it works, but with a video it will take forever and then output the binary representation of the video as text.
For testing the behaviour it should suffice to:
See also comment in this video (user that has PDF with same issue): https://www.youtube.com/watch?v=-IP-mc48n-A&index=9&list=PLS78sux6nBcRR9EyR3sBQxRXXW4jac7TR