Fornaxian / pixeldrain_web

Web interface for pixeldrain.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Downloads are corrupt

mojo-jojo-7 opened this issue · comments

commented

A lot of the downloaded files, rar files in my case, seem to be corrupt. When opening them with 7-Zip, I get "Cannot open file as archive" error. I downloaded the same file from a different host to try and identify the issue and here's what I have:

Something like this is being added to the original files at the beginning

--------------------------c8fb242edb34dd5a
Content-Disposition: form-data; name="name"

Deja-Vu-Dress-for-G8-and-G8.1-Females.rar
--------------------------c8fb242edb34dd5a
Content-Disposition: form-data; name="file"; filename="Deja Vu Dress for G8 and G8.1 Females.rar"
Content-Type: application/octet-stream

and it ends with

--------------------------c8fb242edb34dd5a--

I'm not sure what these are, HTTP headers maybe? Anyway these are getting added to most of the file downloads which makes them unusable, at least without manually editing these out.

The above headers are from this file download: https://pixeldrain.com/u/7S4fPYxe
For debugging, here's the same file uploaded to Mega which doesn't have the error: https://mega.nz/file/yFRkQZAb#1AEX9urM-lm8TY9iZqPx7hmcD0sSpSyOI1HF6f7_R-U

commented

Yes, these are HTTP multipart headers. The problem is not with pixeldrain but the program used to upload the files. Pixeldrain has two endpoint for uploading files, the PUT endpoint and the POST endpoint. PUT is for uploading raw files without multipart encoding, and POST is for uploading files with form encoding.

If you send a form-encoded file to the PUT endpoint the entire stream is saved, including the form headers.

I have added a filter to the server to prevent people from uploading files with Content-Type 'multipart/form-data', but if the Content-Type header is not properly set the filter doesn't work either.

Anyway, nothing more I can do about this. Just tell the uploader to upload their files properly.

commented

I have added a filter to the server to prevent people from uploading files with Content-Type 'multipart/form-data'

I added this on 19 February. The file you linked was uploaded on 9 February, so the check was not in place yet. The owner of the file needs to reupload it.

commented

That clears it up. Thanks for the quick response!