Welcome to WebmasterWorld Guest from

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

Large Upload = Blank Screen



1:59 pm on Mar 17, 2011 (gmt 0)

5+ Year Member

I am trying to do a large file upload using PHP. I have the upload working with files I've tested up to 85MB. The files upload successfully but the problem is the page comes back "blank".

Here is what I've put in the php 4.9 INI file:
upload_max_filesize = 200M
post_max_size = 200M
memory_limit = 240M
max_execution_time = "300"
max_input_time = "300"

On the last 2 fields I've changed those to 3000 but I dont think they take effect until the GoDaddy servers pick them up later on.

The script is working and if I view source on the "blank" page I can see the HTML for the page there...but the page is just coming back blank.

Here is the source:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
$target_path = "somedirectory/";

$target_path = $target_path . basename( $_FILES['uploadedfile']['name']);

if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'], $target_path)) {
echo "The file ". basename( $_FILES['uploadedfile']['name']).
" has been uploaded";
} else{
echo "There was an error uploading the file, please try again!";
<form enctype="multipart/form-data" action="index.php" method="POST">
<input type="hidden" name="MAX_FILE_SIZE" value="10000000000000" />
Choose a file to upload: <input name="uploadedfile" type="file" /><br />
<input type="submit" value="Upload File" />

I've tested 1 to 20mb files and they upload fine and get the page contents.

Any thoughts?



3:16 pm on Mar 17, 2011 (gmt 0)

WebmasterWorld Senior Member 5+ Year Member

Hi there IntegrityWebDev,


Just something that jumped off the screen to me, always use the correct tags when declaring a php document - this can cause all sorts of error's.



would be best.



3:31 pm on Mar 17, 2011 (gmt 0)

5+ Year Member

Hey Mathew, you are right! I broke one of my own cardinal rules there. :-) I just did a test and it seemed to work. I will test with a larger file and post back if there are any problems. ...it's always the little thing.... ;-)


4:06 pm on Mar 17, 2011 (gmt 0)

WebmasterWorld Senior Member rocknbil is a WebmasterWorld Top Contributor of All Time 10+ Year Member

Your PHP limits may not be enough, the browser may be timing out on the connection. I like to use fork() for such huge data transfers (and other time intensive tasks), this allows you to fork the upload itself as a background process and return an immediate response to the browser.


7:59 pm on Mar 17, 2011 (gmt 0)

5+ Year Member

Fork looks good but I need the file uploaded first so I can query the file for some info I need to put into a DB and immediately display on the screen.


8:07 pm on Mar 17, 2011 (gmt 0)

5+ Year Member

Just tried an 85mb file and the page died (page does not exist after a while)...so it doesn't look like I have it beat yet.

Featured Threads

Hot Threads This Week

Hot Threads This Month