-
Notifications
You must be signed in to change notification settings - Fork 67
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
file_upload broken: example adds newline before EOF on upload #258
Comments
Switching to https://github.com/dinosaure/multipart_form could be an option. Other people reported issues around handling of |
I've verified this with uploading a PNG file using the simple (unstyled) upload example. The uploaded file has two extra bytes at the end, which is also evident from the file size. Can anybody confirm or reject this bug? |
I have the same issue. An unsatisfactory fix is to remove the last two characters. For instance, in the opium example, change the let close filename file prev =
let* () = prev in
let* () = Lwt_unix.close file in
let new_size = (Unix.stat filename).st_size - 2 in
Lwt.return @@ Unix.truncate filename new_size |
A file uploaded with the server in
/example/file_upload
is not identical to the original file as can be verified with a checksum. I believe a newline is added at the end of the file.To reproduce the bug, upload a file with the demo application (either the simple or more styled one) and compare the uploaded file against the original. If this bug is indeed universal, this would render uploading images and other binary formats impossible.
The text was updated successfully, but these errors were encountered: