[bug?] Internal server error with Android HttpPost file upload

#1
Hi, lately I've noticed I get this error when I try to upload an image with my Android app to my server (using LiteSpeed) using Android HttpPost, it all worked fine until a few weeks ago when my host made some updates. If I change the server to my local one on my PC it works perfectly (using Apache on xampp though), I only get the error with my host. I did try to packet sniff my app to see what it is sending exactly, and comparing it with the browser (firefox) the data looks a bit different and seems to be sent differently (note that the file upload works fine from a browser, it just doesn't work anymore from my Android app).

This is how it looks like when it is sent from my app: http://justpaste.it/mi11

This is how it looks like when it is sent from a browser (firefox, and it works fine): http://justpaste.it/mi1c

Even though it's a little different it should still work fine as it did until now, this seems like a security thing which may be blocking my app thinking its doing something bad. I would change my app's code if I could, but this is a standard way to send a file over http on Android..

Can you guys please help me? This is a big problem for me and I need to fix it asap.. The error log only says 500 error, nothing else.

Thanks!
 
Last edited:

mistwang

LiteSpeed Staff
#2
Your android client uses "Transfer-Encoding: chunked" for request body, litespeed should be able to handle it.
I will double check the latest 5.0.x release, if it is due to a regression in 5.0 release. we will fix it.
 
#3
Your android client uses "Transfer-Encoding: chunked" for request body, litespeed should be able to handle it.
I will double check the latest 5.0.x release, if it is due to a regression in 5.0 release. we will fix it.
I am not able to change that Transfer-Encoding: chunked thing, it's the only way I can send a file with android, I'm not really sure what it is doing exactly, aren't all clients working the same? You can only send a big file by chunks, right? So it sounds correct to me.

I took out the file part from the post and it is working fine and it looks like this: http://justpaste.it/mjhv

Thanks a lot!
 
Last edited:

mistwang

LiteSpeed Staff
#4
It is a bug in LSWS 5.0 regarding Chunked Transfer-Encoding. It is fixed in latest build 5.0.3 .
Just tell your host provider to update with command

/usr/local/lsws/admin/misc/lsup.sh -f -v 5.0.3
 
#6
Hey, my host just updated to the latest LiteSpeed version and the problem is back again, is this a new bug?

Uploading from a web browser works fine, but when I upload from my Android app $_FILES is empty in php and no errors. No changes have been made to my app since I first reported this problem here, so it's a web server problem.

The last working version was 5.0.18 (they just installed this older version back and it worked again)

Thanks
 
Last edited:
#7
Hey, my host just updated to the latest LiteSpeed version and the problem is back again, is this a new bug?

Uploading from a web browser works fine, but when I upload from my Android app $_FILES is empty in php and no errors. No changes have been made to my app since I first reported this problem here, so it's a web server problem.

The last working version was 5.0.18 (they just installed this older version back and it worked again)

Thanks
Anyone please?
 

mistwang

LiteSpeed Staff
#8
There are a few bug fix builds for 5.1.15, please try the latest build see if it helps.
/usr/local/lsws/admin/misc/lsup.sh -f -v 5.1.15

If problem persists, we may need to login to the server to investigate what happens.
 
#9
There are a few bug fix builds for 5.1.15, please try the latest build see if it helps.
/usr/local/lsws/admin/misc/lsup.sh -f -v 5.1.15

If problem persists, we may need to login to the server to investigate what happens.
They updated but it's still the same problem, $_FILES is empty in php after upload is complete (it is fine on my local web server, using xampp), as it is mentioned in the first replies here, my Android client uses Transfer-Encoding: chunked if that helps with anything, but if you really would like to test please install ( https://play.google.com/store/apps/details?id=com.netlinkd ) it if you have an Android phone and log in with:

test@netlinkd.com
password: nl123

In the menu (middle) - Edit profile and there you can upload pictures and I have made it so this account shows var_dump($_FILES); after upload.

A packet sniffer would show this: https://justpaste.it/mi11

As for logging in the actual web server I don't have access to that, only the guys at www.mxhost.ro have access.

There must be a reason why 5.0.18 worked and now the latest doesn't. Security feature? Please let me know if you need any other info.

Thanks!
 
#12
This is still a bug right now.. using LiteSpeed 5.2.2
Will this ever get fixed? Please let me know, I may have to switch to a different host as they can no longer host me on 5.0.18 (last working version).

Thanks
 
#13
I've just installed LiteSpeed on Ubuntu on my PC to test. Actually the last working version was 5.0.19, I'm not really sure what is the next version after that, the LiteSpeed log page is confusing, it would be 5.1 but the release date is older than 5.0.19, so what is the next version to test and see what were the changes? I've tested 5.1 and it's broken there.

Is there no other version after 5.0.19?
 
#15
Already tried the last version, it is broken, the last working one was 5.0.19 and I want to find out what is the next release after that to see what they changed there to cause the problem.

Thanks anyway!
 
Top