I am using a java.net.URL.openConnection()
to upload 2 text files to my server (Android to PHP). I am using a similar code to this post. I can get one file uploaded fine but can not figure out how to structure the code for two file. I believe my problem is related to this code.
dos.writeBytes(twoHyphens + boundary + lineEnd);
dos.writeBytes("Content-Disposition: form-data; name='uploaded_file';filename='" + fileName1 + "'" + lineEnd);
dos.writeBytes("Content-Disposition: form-data; name='uploaded_file2';filename='" + fileName2 + "'" + lineEnd);
dos.writeBytes(lineEnd);