@@ -71,14 +71,11 @@ protected String doInBackground(String... params) {
7171 try {
7272 String upLoadServerUri =this .options .url ;
7373
74- // open a URL connection to the Servlet
7574 FileInputStream fileInputStream = new FileInputStream (
7675 sourceFile );
7776 URL url = new URL (upLoadServerUri );
78- // Open a HTTP connection to the URL
7977 conn = (HttpURLConnection ) url .openConnection ();
80- conn .setDoOutput (true ); // Allow Outputs
81- conn .setDoInput (true ); // Allow Inputs
78+
8279 ReadableMapKeySetIterator headerIterator = this .options .headers .keySetIterator ();
8380 while (headerIterator .hasNextKey ()) {
8481 String key = headerIterator .nextKey ();
@@ -89,8 +86,6 @@ protected String doInBackground(String... params) {
8986
9087 conn .setUseCaches (false ); // Don't use a Cached Copy
9188 conn .setRequestMethod (this .options .method );
92- conn .setDoOutput (true );
93- conn .setRequestProperty ("Connection" , "Keep-Alive" );
9489 conn .setRequestProperty ("file" , sourceFileUri );
9590 conn .connect ();
9691 dos = new DataOutputStream (conn .getOutputStream ());
@@ -134,7 +129,9 @@ protected String doInBackground(String... params) {
134129 if (conn .getResponseCode () == 200 ) {
135130 Log .d (TAG , "doInBackground: upload successfully" );
136131 sendProgressEvent (1 );
137- this .promise .resolve ("" );
132+ WritableMap param = Arguments .createMap ();
133+ param .putInt ("status" ,conn .getResponseCode ());
134+ this .promise .resolve (param );
138135 }
139136 else
140137 {
0 commit comments