Javascript/PHP: empty $_POST and $_FILES arrays after FileTransfer() upload
<p>So I have a web app running in a webview on a mobile, and I'm trying to upload a picture from the smartphone to my server, using FileTransfer() just like this:</p>

<pre><code>var imageURI = 'file:///path/to/picture.jpg';
var params = { foo: 'bar' };
var options = new FileUploadOptions();
    options.fileKey = 'file';
    options.fileName = imageURI.substr(imageURI.lastIndexOf('/')+1);
    options.mimeType = 'text/plain';
    options.headers = { Connection: 'close' };
    options.chunkedMode = false;
    options.params = params;
var ft = new FileTransfer();
ft.upload(imageURI, encodeURI('http://example.com/uploads/upload.php'), win, fail, options);
</code></pre>

<p>This code works like a charm if I target <em>upload.php</em> on a <strong>Plesk</strong> server, the picture is sent in <code>$_FILES</code> array, and <code>$_POST['foo'] = 'bar'</code>.</p>

<p>I've put the exacte same <em>upload.php</em> file on a <strong>Debian</strong> server a friend of mine installed, and when I'm targeting it, both <code>$_POST</code> and <code>$_FILES</code> are empty arrays! Everything else works fine, no PHP or server errors, just empty arrays.</p>

<p>As suggested in <a href="https://stackoverflow.com/questions/7852910/php-empty-post-and-files-when-uploading-larger-files">other topics</a> I checked <code>post_max_size</code>, <code>upload_max_filesize</code> and <code>max_input_time</code> that are way above what's needed, and I even added <code>header('Access-Control-Allow-Origin: *');</code> at the begining of <em>upload.php</em>.</p>

<p>Any idea?</p>