Make uploads work with WMF wikis

They use HTTP/1.0, so no HTTP Chunked Transfer. Took me a fucklong
to actually find that out - almost 5 hours as I chased wrong leads,
looked for bugs in the HTTP libs, battled poor network, etc. But
was relatively easy to spot once I started logging HTTP requests.

Now, if only Java had a decent documentation browser...
This commit is contained in:
YuviPanda 2012-10-07 01:20:28 +05:30
parent c5fd1e8fd1
commit d7ad63ad38
3 changed files with 12 additions and 1 deletions

View file

@ -18,6 +18,7 @@ import org.w3c.dom.Document;
import android.net.Uri;
import android.os.AsyncTask;
import android.os.Bundle;
import android.provider.MediaStore;
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
@ -80,6 +81,7 @@ public class ShareActivity extends Activity {
// return str;
return result.getString("/api/upload/@result");
} catch (IOException e) {
e.printStackTrace();
return "Failure";
}
}