I can't upload files with my 7250i. I'm using similar form and php to store uploaded files. However print_r($_FILES) prints nothing. I don't know if this is a php problem or has my gsm operator somehow disabled the possibility to upload files. However I can upload <input type="text" name="textfield"> just fine.
I am using server-side Java and com.oreilly.servlet package
for handling the image uploads.
I also had some problems in receiving files,
and I had to make small adjustment to the servlet package
so that it would be compatible with 7250i request.
There was a small compatibility problem in com.oreilly.servlet that I fixed.
The Content-Disposition has extra white space.
Somewhere in the code an extra trim was needed.
Sure, here is a fix to
MultipartParser.java line 380 in
package com.oreilly.servlet.multipart
This fix is a workaround so that
file upload works with a Nokia 7250i
// added trim
String disposition = line.substring(start + 21, end).trim();
if (!disposition.equals("form-data")) {
// this exception was thrown before the fix
throw new IOException("Invalid content disposition: [" + disposition +
"]");
}
Thank you for getting back to me so quickly. Unfortunately I am using a com.oreilly.servlet package installed on a free servlet web space site called mycgiserver.com. I cannot edit MultipartParser.java line 380 !
Can you think of another way to do this ? I have attached my code if this helps.
I have another question for you if you have time....
I can successfully upload images&files using my html browser on my pc.
However when I use an emulater I get the following error:
_________________________
java.io.IOException: Content disposition corrupt: Content-Disposition:form-data;name="upfile";filename="test.txt"|content-disposition:form-data;name="upfile";filename="test.txt"|-1|29
at cryan2.com.oreilly.servlet.multipart.MultipartParser.extractDispositionInfo(MultipartParser.java:377)
at cryan2.com.oreilly.servlet.multipart.MultipartParser.readNextPart(MultipartParser.java:300)
at cryan2.com.oreilly.servlet.MultipartRequest.<init>(MultipartRequest.java:246)
at cryan2.com.oreilly.servlet.MultipartRequest.<init>(MultipartRequest.java:109)
at cryan2.Uploaderxhtml.doPost(Uploaderxhtml.java:22)
________________________________
when I test this on my phone I get "Internal error in gateway".
Do you know why this error has occured? Do you have a url that I could try to upload to, to check if my phone can actually upload?
If you have access to cos source code, look again
at MultipartParser.java in package com.oreilly.servlet.multipart
and try something like this.
// added trim
String disposition = line.substring(start + 21, end).trim();
if (!disposition.equals("form-data")) {
// this exception was thrown before the fix
throw new IOException("Invalid content disposition: [" + disposition +
"]");
}