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>