Note that there are some explanatory texts on larger screens.

plurals
  1. POiframe transport isn't transferring any data
    primarykey
    data
    text
    <p>I'm using <a href="https://github.com/blueimp/jQuery-File-Upload/" rel="nofollow">jQuery-File-Upload</a> with <a href="http://cmlenz.github.com/jquery-iframe-transport/" rel="nofollow">jQuery-Iframe-Transport</a> to try to get support for older versions of IE.</p> <p>I've set the <a href="https://github.com/blueimp/jQuery-File-Upload/wiki/Options" rel="nofollow"><code>forceIframeTransport</code></a> option to <code>true</code> so that it behaves more or less the same way in all browsers, but I don't seem to get any data back on the server-side regardless of browser when it uses the iframe transport.</p> <p>I've spat out the request headers server-side and I get back:</p> <pre><code>array( Host =&gt; "*******" Connection =&gt; "keep-alive" Content-Length =&gt; "0" Accept =&gt; "*/*" Origin =&gt; "**************" X-Requested-With =&gt; "XMLHttpRequest" User-Agent =&gt; "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.17 (KHTML, like Gecko) Chrome/24.0.1312.57 Safari/537.17" DNT =&gt; "1" Referer =&gt; "***********" Accept-Encoding =&gt; "gzip,deflate,sdch" Accept-Language =&gt; "en-GB,en-US;q=0.8,en;q=0.6" Accept-Charset =&gt; "ISO-8859-1,utf-8;q=0.7,*;q=0.3" Cookie =&gt; "*********" ) </code></pre> <p>[<code>*****</code>s indicated bleeped out info; you don't need that ;)]</p> <p>Which look OK, but <code>$_REQUEST</code> is empty (i.e., <code>array()</code>), and the input buffer is empty too:</p> <pre><code>$handle = fopen('php://input', 'r'); $file_data = ''; while(($buffer = fgets($handle, 4096)) !== false) { $file_data .= $buffer; } fclose($handle); // $file_data = ''; </code></pre> <p>This all worked fine when I wasn't using the iframe-transport but I need IE support... does anyone have any experience with transmitting files using iframes and might know why no data is coming through?</p> <hr> <p>When I use <a href="https://github.com/blueimp/jQuery-File-Upload/blob/master/js/jquery.iframe-transport.js" rel="nofollow">jQuery-File-Upload / js / jquery.iframe-transport.js</a> and force iframe transport it works in Chrome, but the requests don't even make it to the server in IE. </p> <p>When I use <a href="https://github.com/cmlenz/jquery-iframe-transport/blob/master/jquery.iframe-transport.js" rel="nofollow">jquery-iframe-transport / jquery.iframe-transport.js</a> and force iframe transport it breaks in Chrome, but that's fine because Chrome supports proper XHR file transfers, <em>and</em> the requests at least hit the server in IE <em>but</em> no data comes through.</p> <p>I've updated my script to support either transfer method:</p> <pre><code>if(empty($_FILES)) { $handle = fopen('php://input', 'r'); $file_data = ''; while(($buffer = fgets($handle, 4096)) !== false) { $file_data .= $buffer; } fclose($handle); } else { $file_data = file_get_contents($_FILES['files']['tmp_name'][0]); } </code></pre> <p>But again, I still can't seem to get any data in IE regardless of what I do.</p> <p>When I say "IE", I'm specifically testing in IE 8 right now. I need support back to 7 though. <a href="http://cmlenz.github.com/jquery-iframe-transport/" rel="nofollow">This guy</a> claims support all the way back to IE 6.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload