created asimple upload form at
Ok it will upload .txt, .pdf and .doc files but not zip files
Seems to be down to size a small zip file is uploaded but a 10mb one isn't.
Is this a server issue or a settingin the upload behaviour?
This is most likely down to your PHP configuration.
Namely POST_MAX_SIZE and UPLOAD_MAX_FILESIZE. Maybe even the time limit allowed for the script to run.
If your host allows you can change this with some PHP at the top of the page in question.
Hope that helps?
I added the code to the top of
but it made no difference so i deleted the code I contacted the hoster who tells me that the upload limit onn their shared platform is 20mb and is cannot be changed.
I then created zip files
2,3,4,6,8,10,15 and 19mb in size
2 3 and 4 are uploaded ok but anything larger fails the progress bar dissapears in around 15 secs but I am on 40mb broadband
think I'm looking in the wrong direction for my issue
Discovered that when I upload a file called test.txt or 2mb.zip the file is uploaded with the name
.txt or .zip
ie it's not picking up the file name.
I've clearly missed a step out
In the form upload settings I've just checked the box "save uploaded files" and set the file upload folder to "uploads"
Is there somewhere I should specify use the original file name?
That issue is solved found an error in the PHP - impressed myself!!!
Now to try the time limit code
despite my best efforts I am still unable to upload any file over 5mb
I contacted the hosting company who advised me that the fixed limit is 20mb
They even uploaded their own "working" test script.
this fails as well proving that the issue is not with form builder which is not helpful to me.
However thier script shows an error list when a file uploads or not
However they seem unwilling to take it any further.
When an upload is sucessfull I see
File is valid, and was successfully uploaded.
[userfile] => Array
[name] => 2mb.zip
[type] => application/x-zip-compressed
[tmp_name] => /tmp/phpkPE1jF
[error] => 0
[size] => 2351083
When it fails I see
I know it's not a WA error but would appreciate a hint on how to proceed from here
judging by the content of the debug info, it sounds like are using a variable dump of the FILES array;
<?php var_dump($_FILES); ?>
and when it fails, is because the files array does not have any contents.
this suggests that the problem is one of these settings:
to help determine which, use the following code to write the settings tot he page:
//write php.ini settings that effect upload size screen to
echo("upload_max_filesize: ".ini_get('upload_max_filesize')."<br />".
"post_max_size: ".ini_get('post_max_size')."<br />".
"memory_limit: ".ini_get('memory_limit')."<br />".
"max_input_time: ".ini_get('max_input_time')." seconds<br />".
"max_execution_time: ".ini_get('max_execution_time')." seconds<br />");
on your upload page, you can use the following code to show the POST and FILE array contents, this can be helpful for troubleshooting:
//write POST contents to screen
//writes files array to screen
Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.
These out-of-the-box solutions provide you proven, tested applications that can be up and running now. Build a store, a gallery, or a web-based email solution.