kartikarora / Transfer.sh

Easy file sharing from your Android device!
https://play.google.com/store/apps/details?id=me.kartikarora.transfersh
Other
16 stars 3 forks source link

Single file upload issue but on server looks like multiple files were uploaded #12

Open mrizvic opened 6 years ago

mrizvic commented 6 years ago

I tried to upload audio file via Android app but I got toast notification saying 'something went wrong'. After examining log files I found this:

2018/02/27 17:05:37 Uploading KBuyi Voice 010.m4a 3751077 multipart/form-data; boundary=36d90af5-e899-419a-91f0-53174f77c61f 2018/02/27 17:05:37 Uploading MiTAr Voice 010.m4a 3751076 multipart/form-data; boundary=b00bc6ec-901d-47f8-b700-62038b96b56d 2018/02/27 17:05:38 Error putting new file: unexpected EOF 2018/02/27 17:05:38 Error putting new file: unexpected EOF 2018/02/27 17:05:38 192.168.1.27:38645 - - [2018-02-27T17:05:38Z] "PUT /Voice%20010.m4a HTTP/1.1" 500 "" "Dalvik/2.1.0 (Linux; U; Android 6.0.1; SM-G903F Build/MMB29K)" 2018/02/27 17:05:38 192.168.1.27:49287 - - [2018-02-27T17:05:38Z] "PUT /Voice%20010.m4a HTTP/1.1" 500 "" "Dalvik/2.1.0 (Linux; U; Android 6.0.1; SM-G903F Build/MMB29K)"

So this action returned HTTP 500 ERROR

I tried again using app:

2018/02/27 17:06:28 192.168.1.27:57365 - - [2018-02-27T17:06:28Z] "GET / HTTP/1.1" 200 "" "Dalvik/2.1.0 (Linux; U; Android 6.0.1; SM-G903F Build/MMB29K)" 2018/02/27 17:06:31 Uploading wiUkx Voice 010.m4a 3751076 multipart/form-data; boundary=cd2b5672-39c3-4f54-80ab-eaaa5def14d4 2018/02/27 17:06:49 Error putting new file: unexpected EOF 2018/02/27 17:06:49 192.168.1.27:52489 - - [2018-02-27T17:06:49Z] "PUT /Voice%20010.m4a HTTP/1.1" 500 "" "Dalvik/2.1.0 (Linux; U; Android 6.0.1; SM-G903F Build/MMB29K)"

This also returned HTTP 500 ERROR

Then I got success using chrome browser on phone;

2018/02/27 17:09:22 192.168.1.27:58379 - - [2018-02-27T17:09:22Z] "GET / HTTP/1.1" 200 "" "Mozilla/5.0 (Linux; Android 6.0.1; SM-G903F Build/MMB29K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.137 Mobile Safari/537.36" 2018/02/27 17:09:22 192.168.1.27:58380 - - [2018-02-27T17:09:22Z] "GET /scripts/vendor/modernizr.js HTTP/1.1" 200 10987 "http://xfer.dmz6.net/" "Mozilla/5.0 (Linux; Android 6.0.1; SM-G903F Build/MMB29K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.137 Mobile Safari/537.36" 2018/02/27 17:09:22 192.168.1.27:58382 - - [2018-02-27T17:09:22Z] "GET /images/reviews/kareem.jpg HTTP/1.1" 200 19806 "http://xfer.dmz6.net/" "Mozilla/5.0 (Linux; Android 6.0.1; SM-G903F Build/MMB29K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.137 Mobile Safari/537.36" 2018/02/27 17:09:22 192.168.1.27:58381 - - [2018-02-27T17:09:22Z] "GET /images/reviews/dave.jpg HTTP/1.1" 200 19244 "http://xfer.dmz6.net/" "Mozilla/5.0 (Linux; Android 6.0.1; SM-G903F Build/MMB29K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.137 Mobile Safari/537.36" 2018/02/27 17:09:22 192.168.1.27:58379 - - [2018-02-27T17:09:22Z] "GET /styles/main.css HTTP/1.1" 200 96540 "http://xfer.dmz6.net/" "Mozilla/5.0 (Linux; Android 6.0.1; SM-G903F Build/MMB29K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.137 Mobile Safari/537.36" 2018/02/27 17:09:22 192.168.1.27:58381 - - [2018-02-27T17:09:22Z] "GET /scripts/main.js HTTP/1.1" 200 143888 "http://xfer.dmz6.net/" "Mozilla/5.0 (Linux; Android 6.0.1; SM-G903F Build/MMB29K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.137 Mobile Safari/537.36" 2018/02/27 17:09:22 192.168.1.27:58381 - - [2018-02-27T17:09:22Z] "GET /images/reviews/pg.jpeg HTTP/1.1" 200 30023 "http://xfer.dmz6.net/" "Mozilla/5.0 (Linux; Android 6.0.1; SM-G903F Build/MMB29K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.137 Mobile Safari/537.36" 2018/02/27 17:09:22 192.168.1.27:58381 - - [2018-02-27T17:09:22Z] "GET /images/reviews/jacob.jpg HTTP/1.1" 200 23068 "http://xfer.dmz6.net/" "Mozilla/5.0 (Linux; Android 6.0.1; SM-G903F Build/MMB29K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.137 Mobile Safari/537.36" 2018/02/27 17:09:22 192.168.1.27:58381 - - [2018-02-27T17:09:22Z] "GET /images/reviews/lars.jpg HTTP/1.1" 200 17702 "http://xfer.dmz6.net/" "Mozilla/5.0 (Linux; Android 6.0.1; SM-G903F Build/MMB29K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.137 Mobile Safari/537.36" 2018/02/27 17:09:22 192.168.1.27:58381 - - [2018-02-27T17:09:22Z] "GET /images/tor.svg HTTP/1.1" 200 22905 "http://xfer.dmz6.net/" "Mozilla/5.0 (Linux; Android 6.0.1; SM-G903F Build/MMB29K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.137 Mobile Safari/537.36" 2018/02/27 17:09:22 192.168.1.27:58381 - - [2018-02-27T17:09:22Z] "GET /images/bitcoin.png HTTP/1.1" 200 6157 "http://xfer.dmz6.net/" "Mozilla/5.0 (Linux; Android 6.0.1; SM-G903F Build/MMB29K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.137 Mobile Safari/537.36" 2018/02/27 17:09:22 192.168.1.27:58381 - - [2018-02-27T17:09:22Z] "GET /images/Logo-orange.png HTTP/1.1" 200 9074 "http://xfer.dmz6.net/" "Mozilla/5.0 (Linux; Android 6.0.1; SM-G903FBuild/MMB29K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.137 Mobile Safari/537.36" 2018/02/27 17:09:23 192.168.1.27:58381 - - [2018-02-27T17:09:23Z] "GET /fonts/transfersh.woff HTTP/1.1" 200 3060 "http://xfer.dmz6.net/styles/main.css" "Mozilla/5.0 (Linux; Android 6.0.1; SM-G903F Build/MMB29K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.137 Mobile Safari/537.36" 2018/02/27 17:09:23 192.168.1.27:58379 - - [2018-02-27T17:09:23Z] "GET /images/terminal-top.svg HTTP/1.1" 200 3942 "http://xfer.dmz6.net/styles/main.css" "Mozilla/5.0 (Linux; Android6.0.1; SM-G903F Build/MMB29K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.137 Mobile Safari/537.36" 2018/02/27 17:09:45 192.168.1.27:58381 - - [2018-02-27T17:09:45Z] "GET / HTTP/1.1" 200 "" "Mozilla/5.0 (Linux; Android 6.0.1; SM-G903F Build/MMB29K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.137 Mobile Safari/537.36" 2018/02/27 17:09:45 192.168.1.27:58381 - - [2018-02-27T17:09:45Z] "GET /favicon.ico HTTP/1.1" 200 7686 "http://xfer.dmz6.net/" "Mozilla/5.0 (Linux; Android 6.0.1; SM-G903F Build/MMB29K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.137 Mobile Safari/537.36"

Upload starts here:

2018/02/27 17:09:54 Uploading ahxaR Voice 010.m4a 3750825 audio/x-m4a 2018/02/27 17:09:56 192.168.1.27:58381 - - [2018-02-27T17:09:56Z] "PUT /Voice%20010.m4a HTTP/1.1" 200 "http://xfer.dmz6.net/" "Mozilla/5.0 (Linux; Android 6.0.1; SM-G903F Build/MMB29K) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.137 Mobile Safari/537.36" 2018/02/27 17:22:07 192.168.1.27:34256 - - [2018-02-27T17:22:07Z] "GET / HTTP/1.1" 200 "" "Dalvik/2.1.0 (Linux; U; Android 6.0.1; SM-G903F Build/MMB29K)"

This action returned HTTP 200 OK

Notice the difference in logs between browser upload and app upload. When using app it says:

2018/02/27 17:06:31 Uploading wiUkx Voice 010.m4a 3751076 multipart/form-data; boundary=cd2b5672-39c3-4f54-80ab-eaaa5def14d4 2018/02/27 17:06:49 Error putting new file: unexpected EOF

But when using chrome app its like this:

2018/02/27 17:09:54 Uploading ahxaR Voice 010.m4a 3750825 audio/x-m4a

Here we can see how the log entry is created: https://github.com/dutchcoders/transfer.sh/blob/master/server/handlers.go#L399

log.Printf("Uploading %s %s %d %s", token, filename, contentLength, contentType)

I hope that helps. If there is anything else I can try let me know.

Marko

kartikarora commented 6 years ago

Thanks for reporting this @mrizvic. I'll have a look. Can you give me a sample file to recreate this issue?

mrizvic commented 6 years ago

I uploaded sample file via web page to transfer.sh: https://transfer.sh/DJBup/Voice%20011.m4a

mrizvic commented 6 years ago

Try with this one also: https://transfer.sh/7XqIY/Voice%20013.m4a

kartikarora commented 6 months ago

Hi @mrizvic I am bringing this app back from the dead and will be working on this. I don't have a timeframe but I will dedicate some time to this issue.