I am trying to upload file to a php server from my android device. There is thread with same question but he is using a different method. My Android side code works fine and
It seems that the server is not responding to the client. Try uploading using an ftp connection through the Android application, if that works then check your Apache configuration on accepting connections and the writable directories. When I had a similar problem it turned out that my directory gave no write privileges.
Is the error from Java or from Apache?
Change your code in the following way for the correct escape sequences:
Replace
String lineEnd = "rn";
with
String lineEnd = "\r\n";