jackrabb1t Posted April 26, 2012 Share Posted April 26, 2012 I'm experiencing a very strange issue, and I'm not 100% sure it's PHP-related, but I'd like to at least rule it out if it's not. I've setup a test page here: http://www.linkboard.org/test/ Included on that page are two bookmarks files exported from a browser: one contains data-URI encoded favicons, and the other does not. Uploading both files via the above URL should work just fine in any browser (an array dump of characters should be the result). However, if you change the above URL to include the 'index.php', uploading the file with favicons in it no longer works - it results in a browser time out. If i change the name of the test page to something else, i.e. 'test.php', it will never work since I would always have to specify the page filename in the URL. So, anybody have any ideas? Could this be a server config issue? It doesn't appear to be a browser problem because I experience the exact same issue in Chrome, Firefox, and IE. Edit: Here's the code I'm using on the page: <?php if (isset($_POST['submit'])) { if (is_uploaded_file($_FILES['bookmarks_file']['tmp_name'])) { $file = fopen($_FILES['bookmarks_file']['tmp_name'], "r"); if ($file != false && $_FILES['bookmarks_file']['type'] == 'text/html') { $charArray = array(); while (!feof($file)) { $charArray[] = fgetc($file); } fclose($file); var_dump($charArray); } } } ?> <h2>Test Import</h2> <p><a href="bookmarks_4_24_12-favicon.html">Bookmarks file <strong>with</strong> Favicons</a><br /> <a href="bookmarks_4_24_12.html">Bookmarks file <strong>without</strong> Favicons</a></p> <p>Upload one of the above files with this form. If successful, the program will print out file contents.</p> <form enctype="multipart/form-data" action="<?php echo $PHP_SELF; ?>" method="POST"> <input type="file" name="bookmarks_file" /><br /><br /> <button type="submit" name="submit">Submit</button> </form> Quote Link to comment https://forums.phpfreaks.com/topic/261663-file-upload-times-out-when-page-filename-is-in-url/ Share on other sites More sharing options...
xyph Posted April 26, 2012 Share Posted April 26, 2012 Both test/ and test/index.php work for me, when uploading 'bookmarks_4_24_12-favicon.html' The result is a large array, each key with a single character Quote Link to comment https://forums.phpfreaks.com/topic/261663-file-upload-times-out-when-page-filename-is-in-url/#findComment-1340838 Share on other sites More sharing options...
jackrabb1t Posted April 26, 2012 Author Share Posted April 26, 2012 Both test/ and test/index.php work for me, when uploading 'bookmarks_4_24_12-favicon.html' The result is a large array, each key with a single character What browser/OS are you using? I've tried 3 different browsers and 3 different computers, and the favicon bookmarks file always times out when I specify 'index.php'. Edit: Just tried 'test/index.php' on a Mac in Safari and it worked just fine. Tried 'test/index.php' in Firefox on that same Mac and it did not work. Now I'm really getting annoyed. Quote Link to comment https://forums.phpfreaks.com/topic/261663-file-upload-times-out-when-page-filename-is-in-url/#findComment-1340843 Share on other sites More sharing options...
xyph Posted April 26, 2012 Share Posted April 26, 2012 Chrome, Firefox and IE on Win7 x64. All latest releases. All work with both test/ and test/index.php. Here's the internals of the file I'm uploading, just to make sure my clients haven't performed changes while downloading your file <!DOCTYPE NETSCAPE-Bookmark-file-1> <!-- This is an automatically generated file. It will be read and overwritten. DO NOT EDIT! --> <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=UTF-8"> <TITLE>Bookmarks</TITLE> <H1>Bookmarks</H1> <DL><p> <DT><H3 ADD_DATE="1318357439" LAST_MODIFIED="1332189402" PERSONAL_TOOLBAR_FOLDER="true">Bookmarks bar</H3> <DL><p> <DT><A HREF="https://www.google.com/" ADD_DATE="1332189380" ICON="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAADCklEQVQ4jSXSy2ucVRjA4d97zvdNJpPJbTJJE9rYaCINShZtRCFIA1bbLryBUlyoLQjqVl12W7UbN4qb1gtuYhFRRBCDBITaesFbbI3RFBLSptEY05l0ZjLfnMvrov/Bs3gAcF71x6VVHTk+o8nDH+hrH89rUK9Z9Yaen57S3wVtGaMBNGC0IegWKIDxTtVaOHVugZVmH3HX3Zz+4l+W1xvkOjuZfPsspY4CNkZELEgEIJKwYlBjEwjec/mfCMVuorVs76R8+P0KYMmP30U2dT8eIZqAR2ipRcWjEYxGSCRhV08e04oYMoxYLi97EI9YCJ0FHBYbIVGDlUBLwRlLIuYW6chEmQt/rJO09RJjhjEJEYvJYGNhkbUhw43OXtIWDFRq9G87nAaSK6sVRm8r8fzRMWbOX2Xx7ypd7ZET03sQhDOz73DqSJOrd+7HSo4QIu0Nx/4rOzx+cRXZ9+z7+uqJ+3hiepxK3fHZT2tMjXYzOtzL6dmznPzhLexgN0QlxAAYxAlqUqRmkf5j59RlNQ6MFHhgcpCTTx8EUb5e+plD7x4jjg1ANCAgrRQAdR7xKXjBlGyLYi7PxaUmb8z8xcpGHVXLHaXdjI0egKyJiQYTEhSPREVIEUBNC+Mqm+xpz3j0njLPHB2nsh1QgeG+IS48dYbD5YNoo0ZUAbVEuTUoKuBSZOarX/WhyQn6eg2+usDWf0s0tq8zNPYk+WI/Lnge++hlvlyfQ3NdECzGRWKwEEA0qNY251n69kV6+Y0kbaCZoebG2X3oU7pKoyxuXOPe945zs9DCeosGIXoBDyaLdf6ce4Hbk+/Y299ksKtAuaeNsiyw8c1LKIZ95b0MdgxA5giixACpTxEPSau6QdFfI5/2cLPmEW+JAQrtJUJzDXF1dkwHzVodJMX4HFEcQQMaFdPeM0Jb/4PUtzzaLKAhRyJFwo6lbegRNFfk819muV5dR4JBQoQdQ2xFiDmSNDHiaptamR9Gq5cQ18AledrGDpOfeI5Lq8u88smbhMRisoSAgAYghdfn5H/JkHuRZ1owLAAAAABJRU5ErkJggg==">Google</A> <DT><A HREF="http://www.yahoo.com/" ADD_DATE="1332189389" ICON="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABaklEQVQ4jdWSMUtCYRSGH+WODhcRsTAxcBIHCacKUjFoCKloCZqkH9DQJApG4tTcENUgTVIi4RBhZhDhYCByESIxCTEJqRChCMMGuZeu5Q/wTIfvO+d5z/neD0Y+NHKSCRV67UYbKVVTFdjcZox2Pb6oS6kNavd7KkAmVOjd7pWGqny+d/EGpxSICiA3r58sMOkZA+Dx6pn0Zp6m1FKBZIgMsLlNCC/lVwCOV89xLFlZPvRQzTZoSi22PwIAvN232XUeUD57UgEt0+MIlVxdOZBSNayzD8yFncjg650iF7EsHerUpX6dyWFQphMG901v3WB2GVg7necyfEcyFlfuBEQAdIZ+my/q0mhtbvOfRyslqgCqZlkZQLTqlFww2vUq6zYyi0zMGOl+fRMpRiglqiRjcUQc2P0WKMHKkVexVLFxUO13iDj+2Ghzmwhk/RpB3kX+SLVck0ot3x9ZdP77kQxWHZ1Wd6jgiMUPrROOBOa0KcsAAAAASUVORK5CYII=">Yahoo!</A> <DT><A HREF="http://www.bing.com/" ADD_DATE="1332189402" ICON="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAABIklEQVQ4jaWTIUzDUBCGvxJW04THBFWrGAZThSI0GNwcjjkccg4HDodDTqFIHRKFIjRgpoqYqihmM6MkNZ0Y4vLaLm1JWC95uZfL+7939+6dsXrcW9HCttqIAbYB6LrQUbBMYBFuADi8BfsY5gG8nG0AqDNTwa4r+z8yWwd0diSb3gAsp3r66xmmY5i/NQC6rqw0hvAOZoHELQf2hwLuDSDy4X3UUELkw+QGsqQa7w/h6F589gOT65o21onLkMiXff8c0P9AC9K4WawtjcWbqgTQj2I5YHvNYlNJ+iWQAKbjok0nD3BwWRXbHpw+ySVZAq8XABj5LJgK3KtCnCXw/Vlkptu6COFjlF9oVIbJcqRVtpfXmZc5C9b+QD3gn9Z6Gn8BcuVdnjGhH18AAAAASUVORK5CYII=">Bing</A> </DL><p> </DL><p> I doubt it's a server-side issue, but I don't see any scripting/cookies that would make it a client-side issue either. Do you have access to your PHP/Apache error logs? What kind of errors are generated when it times out? Quote Link to comment https://forums.phpfreaks.com/topic/261663-file-upload-times-out-when-page-filename-is-in-url/#findComment-1340867 Share on other sites More sharing options...
jackrabb1t Posted April 27, 2012 Author Share Posted April 27, 2012 I'm starting to think it's a network configuration problem - I had been testing it on my university's network (even though Safari on Mac worked), but then I went home and tried it there and didn't have any problems. Maybe some kind of traffic shaping is causing this issue? I don't have access to any server logs since I'm on a shared host. Quote Link to comment https://forums.phpfreaks.com/topic/261663-file-upload-times-out-when-page-filename-is-in-url/#findComment-1341129 Share on other sites More sharing options...
xyph Posted April 27, 2012 Share Posted April 27, 2012 I've used many shared hosts that give your error logs. Check cPanel if you have it, there will probably be a link. Quote Link to comment https://forums.phpfreaks.com/topic/261663-file-upload-times-out-when-page-filename-is-in-url/#findComment-1341170 Share on other sites More sharing options...
jackrabb1t Posted April 27, 2012 Author Share Posted April 27, 2012 I've used many shared hosts that give your error logs. Check cPanel if you have it, there will probably be a link. Nevermind, I found them. There doesn't seem to be anything in there relating to this problem. Quote Link to comment https://forums.phpfreaks.com/topic/261663-file-upload-times-out-when-page-filename-is-in-url/#findComment-1341182 Share on other sites More sharing options...
xyph Posted April 27, 2012 Share Posted April 27, 2012 It's hard to help further. Possibly a network issue. I can tell you it works fine from my home, my girlfriend's, and my work. Quote Link to comment https://forums.phpfreaks.com/topic/261663-file-upload-times-out-when-page-filename-is-in-url/#findComment-1341187 Share on other sites More sharing options...
jackrabb1t Posted April 27, 2012 Author Share Posted April 27, 2012 It's hard to help further. Possibly a network issue. I can tell you it works fine from my home, my girlfriend's, and my work. Thank you very much for helping to test. It does really seem like some sort of network issue....everywhere I try that is not on this campus I don't have any issues. Quote Link to comment https://forums.phpfreaks.com/topic/261663-file-upload-times-out-when-page-filename-is-in-url/#findComment-1341189 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.