title: Phonegap file transfer using ashx http handler - files are not found on server
body: <p>I'm trying to upload an image to a remote server using Phonegap's (3.4.0) file transfer and an ashx http handler. I'm using eclipse and running the app on a galaxy s3 device.
  here's my code:</p>
  
  <p>js:</p>
  
  <pre><code>function updateUserImage(userId,imageURI) {
      //imageURI is in the format of file:///...
      alert("in update()");
      window.resolveLocalFileSystemURL(imageURI, onResolveSuccess, fail);
  }
  
  function onResolveSuccess(fileEntry) {
  
      var options = new FileUploadOptions(); // PhoneGap object to allow server upload
          options.fileKey = "file";
          options.fileName = "1000.jpg";
          options.mimeType = "image/jpeg"; // file type
          options.chunkedMode = false;
          var params = {};
          params.value1 = "test";
          params.value2 = "param";
          options.params = params;
          options.headers = {
              Connection: "close"
          };
  
      var ft = new FileTransfer();
      alert("resolve success");
      alert(fileEntry.toURL());
      ft.upload(fileEntry.toURL(), encodeURI("http://www.xxxx.com/ReturnValue.ashx"), win, fail, options, true); // Upload
  }
  function win(r) {
      alert("win");
      alert(r.response);
  }
  </code></pre>
  
  <p>ashx:</p>
  
  <pre><code>&lt;%@ WebHandler Language="C#" Class="ReturnValue" %&gt;
  
   using System;
   using System.Web;
  
  public class ReturnValue : IHttpHandler
  {
  
       public void ProcessRequest(HttpContext context)
       {
           context.Response.Write(context.Request.Files.Count);
       }
  
       public bool IsReusable
       {
            get
            {
                 return false;
            }
       }
  
  }
  </code></pre>
  
  <p>logcat:</p>
  
  <pre><code>05-14 17:56:01.834: V/webview(2125):  singleCursorHandlerTouchEvent -getEditableSupport  FASLE 
  05-14 17:56:02.224: W/PluginManager(2125): THREAD WARNING: exec() call to Camera.takePicture blocked the main thread for 56ms. Plugin should use CordovaInterface.getThreadPool().
  05-14 17:56:02.224: D/CordovaActivity(2125): Paused the application!
  05-14 17:56:02.224: D/CordovaWebView(2125): Handle the pause
  05-14 17:56:02.819: W/IInputConnectionWrapper(2125): showStatusIcon on inactive InputConnection
  05-14 17:56:08.274: D/CordovaActivity(2125): Incoming Result
  05-14 17:56:08.274: D/CordovaActivity(2125): Request code = 34
  05-14 17:56:08.274: D/CordovaActivity(2125): We have a callback to send this result to
  05-14 17:56:08.314: D/dalvikvm(2125): GC_FOR_ALLOC freed 841K, 11% free 12366K/13831K, paused 16ms, total 24ms
  05-14 17:56:08.379: I/dalvikvm-heap(2125): Grow heap (frag case) to 43.056MB for 31961104-byte allocation
  05-14 17:56:08.394: D/dalvikvm(2125): GC_FOR_ALLOC freed 6K, 4% free 43571K/45063K, paused 14ms, total 14ms
  05-14 17:56:08.394: W/CursorWrapperInner(2125): Cursor finalized without prior close()
  05-14 17:56:08.409: D/dalvikvm(2125): GC_CONCURRENT freed &lt;1K, 4% free 43571K/45063K, paused 2ms+3ms, total 16ms
  05-14 17:56:10.139: D/dalvikvm(2125): WAIT_FOR_CONCURRENT_GC blocked 0ms
  05-14 17:56:10.169: D/dalvikvm(2125): GC_EXPLICIT freed 31267K, 73% free 12321K/45063K, paused 3ms+4ms, total 30ms
  05-14 17:56:10.169: E/System(2125): Uncaught exception thrown by finalizer
  05-14 17:56:10.174: E/System(2125): java.io.IOException: close failed: EIO (I/O error)
  05-14 17:56:10.174: E/System(2125):     at libcore.io.IoUtils.close(IoUtils.java:41)
  05-14 17:56:10.174: E/System(2125):     at java.io.FileInputStream.close(FileInputStream.java:121)
  05-14 17:56:10.174: E/System(2125):     at java.io.FileInputStream.finalize(FileInputStream.java:142)
  05-14 17:56:10.174: E/System(2125):     at java.lang.Daemons$FinalizerDaemon.doFinalize(Daemons.java:186)
  05-14 17:56:10.174: E/System(2125):     at java.lang.Daemons$FinalizerDaemon.run(Daemons.java:169)
  05-14 17:56:10.174: E/System(2125):     at java.lang.Thread.run(Thread.java:856)
  05-14 17:56:10.174: E/System(2125): Caused by: libcore.io.ErrnoException: close failed: EIO (I/O error)
  05-14 17:56:10.174: E/System(2125):     at libcore.io.Posix.close(Native Method)
  05-14 17:56:10.174: E/System(2125):     at libcore.io.BlockGuardOs.close(BlockGuardOs.java:75)
  05-14 17:56:10.174: E/System(2125):     at libcore.io.IoUtils.close(IoUtils.java:38)
  05-14 17:56:10.174: E/System(2125):     ... 5 more
  05-14 17:56:10.174: W/CursorWrapperInner(2125): Cursor finalized without prior close()
  05-14 17:56:10.174: I/CordovaLog(2125): Changing log level to DEBUG(3)
  05-14 17:56:10.179: D/Whitelist(2125): Unlimited access to network resources
  05-14 17:56:10.179: D/CordovaActivity(2125): Resuming the App
  05-14 17:56:10.179: D/CordovaActivity(2125): CB-3064: The errorUrl is null
  05-14 17:56:10.234: D/CordovaLog(2125): file:///android_asset/www/index.html: Line 23 : file:///storage/sdcard0/Android/data/com.phonegap.helloworld/cache/1400079368295.jpg
  05-14 17:56:10.234: I/Web Console(2125): file:///storage/sdcard0/Android/data/com.phonegap.helloworld/cache/1400079368295.jpg:23
  05-14 17:56:10.289: D/dalvikvm(2125): GC_CONCURRENT freed 42K, 72% free 12737K/45063K, paused 2ms+13ms, total 28ms
  05-14 17:56:10.304: D/SoftKeyboardDetect(2125): Ignore this event
  05-14 17:56:10.454: D/SoftKeyboardDetect(2125): Ignore this event
  05-14 17:56:16.739: D/FileTransfer(2125): upload file:///storage/sdcard0/Android/data/com.phonegap.helloworld/cache/1400079368295.jpg to http://www.xxxx.com/ReturnValue.ashx
  05-14 17:56:16.739: D/FileTransfer(2125): fileKey: file
  05-14 17:56:16.739: D/FileTransfer(2125): fileName: 1000.jpg
  05-14 17:56:16.739: D/FileTransfer(2125): mimeType: image/jpeg
  05-14 17:56:16.739: D/FileTransfer(2125): params: {"value1":"test","value2":"param"}
  05-14 17:56:16.739: D/FileTransfer(2125): trustEveryone: true
  05-14 17:56:16.739: D/FileTransfer(2125): chunkedMode: false
  05-14 17:56:16.739: D/FileTransfer(2125): headers: {"Connection":"close"}
  05-14 17:56:16.739: D/FileTransfer(2125): objectId: 1
  05-14 17:56:16.739: D/FileTransfer(2125): httpMethod: POST
  05-14 17:56:16.764: D/FileTransfer(2125): Content Length: 358920
  05-14 17:56:34.384: D/dalvikvm(2125): GC_CONCURRENT freed 150K, 72% free 12974K/45063K, paused 8ms+5ms, total 47ms
  05-14 17:56:58.089: D/FileTransfer(2125): Uploaded 114920 of 358920 bytes
  05-14 17:57:15.299: D/FileTransfer(2125): Uploaded 229608 of 358920 bytes
  05-14 17:57:17.069: D/FileTransfer(2125): Uploaded 344296 of 358920 bytes
  05-14 17:57:17.704: D/FileTransfer(2125): Sent 358920 of 358920
  05-14 17:57:22.229: D/FileTransfer(2125): response code: 200
  05-14 17:57:22.234: D/FileTransfer(2125): response headers: {null=[HTTP/1.1 200 OK], Cache-Control=[private], Connection=[close], Content-Type=[text/html; charset=utf-8], Date=[Wed, 14 May 2014 14:57:33 GMT], OkHttp-Received-Millis=[1400079442236], OkHttp-Response-Source=[NETWORK 200], OkHttp-Selected-Transport=[http/1.1], OkHttp-Sent-Millis=[1400079441802], Server=[Microsoft-IIS/8.0], Vary=[Accept-Encoding], X-AspNet-Version=[4.0.30319], X-Powered-By=[ASP.NET], X-Powered-By-Plesk=[PleskWin]}
  05-14 17:57:22.239: D/FileTransfer(2125): got response from server
  05-14 17:57:22.239: D/FileTransfer(2125): 0
  05-14 17:57:22.334: D/dalvikvm(2125): GC_CONCURRENT freed 778K, 72% free 12691K/45063K, paused 5ms+4ms, total 29ms
  05-14 17:
  </code></pre>
  
  <p>my config.xml has <code>&lt;access origin="*"/&gt;</code> in it, and manifest file has <code>&lt;uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /&gt;</code>.</p>
  
  <p>I get a response "0" from the server, which means it didn't get any of the files. But on the other hand, logcat says "Sent 358920 of 358920".</p>
  
  <p>Any help solving this would be greatly appreciated.</p>