Jump to content

File Upload Times Out When Page Filename is in URL


jackrabb1t

Recommended Posts

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>

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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?

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.