Interesting problem with PHP file uploads

Associate
Joined
30 Dec 2005
Posts
415
Hey to all,

I'm currently trying to write a file uploader, but hit an interesting problem - some files just won't upload!

I've tried the following files:
testing.mp3 - 10.0mb (browser uploads it fine)
What About Bob.mp3 - 243mb (browser uploads it fine)
mix.mp3 - 10.1mb (won't upload)

When I say it doesn't upload, when I press the upload button on my form, the browser literally refreshes the page... it doesn't show the progress bar for a few seconds to indicate that it's uploading the file.

I've tried taking a few seconds off mix.mp3 and resaving it as a different filename (alters the filesize and ensures it's not corrupt), but still no joy.

The PHP page that receives the file:
Code:
print_r($_POST);
print_r($_FILES);
I get: Array() Array()

Here is the code for my form:
Code:
<form name="register" action="djenter.php" method="post" enctype="multipart/form-data">
<label for="djname">Your mix:</label><br />
<input class="inputo" type="file" name="mix" id="mix" value="Choose" />
<input type="submit" name="submit" id="submit" value="Submit my entry!" class="submito" />

I've also set upload_max_filesize to 15M in php.ini.

Anyone got any ideas / thoughts?

Cheers,
Rich
 
max_post_size will affect file uploads aswell.

Sorry I think I gave you a red herring there.

What About Bob.mp3 - 243mb (browser uploads it fine)

Is that correct? 243mb?
 
Last edited:
Sorry I think I gave you a red herring there.

What About Bob.mp3 - 243mb (browser uploads it fine)

Is that correct? 243mb?

Yeah. That's the file that's confused me. When you press the submit button, the page goes blank like it's uploading the file, and the status bar slowly progresses. It looks like PHP is accepting the file transfer.

I don't wait for it to complete the upload though, as it's only going to fail - upload_max_filesize is set to 16mb.


I've stripped the receiving PHP script down to just print_r($_POST); print_r($_FILES); at the moment, to ensure it's not that that's the problem.
 
Back
Top Bottom