zip files
Hi
created asimple upload form at
upload.php
Ok it will upload .txt, .pdf and .doc files but not zip files
any ideas
thanks
Ian
Hi
created asimple upload form at
upload.php
Ok it will upload .txt, .pdf and .doc files but not zip files
any ideas
thanks
Ian
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?
thanks
Ian
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.
<?php
ini_set('post_max_size', '64M');
ini_set('upload_max_filesize', '64M');
set_time_limit ("360");
?>
Hope that helps?
Cheers
Ian
Ian is correct, the default setting for the upload_max_filesize setting in the php.ini file is 2MB, that is most likely the culprit.
see this page for details on all of the possible settings that can effect upload file size:
wap_upload.asp?page=php2
HI
I added the code to the top of
upload.php
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
any ideas?
thanks
Ian
could be the post_max_size or max_execution_time time settings as well, see the page i linked to in my previous post:
wap_upload.asp?page=php2
Hi
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?
thanks
Ian
That issue is solved found an error in the PHP - impressed myself!!!
Now to try the time limit code
Ian
Hi
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.
Debug Information:
Array
(
[userfile] => Array
(
[name] => 2mb.zip
[type] => application/x-zip-compressed
[tmp_name] => /tmp/phpkPE1jF
[error] => 0
[size] => 2351083
)
)
When it fails I see
Upload failed
Debug Information:
Array
(
)
I know it's not a WA error but would appreciate a hint on how to proceed from here
thanks
Ian
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:
post_max_size
memory_limit
max_input_time
max_execution_time
to help determine which, use the following code to write the settings tot he page:
<?php
//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:
<?php
//write POST contents to screen
echo("POST:<pre>");
var_dump($_POST);
echo("</pre><br />");
?>
<?php
//writes files array to screen
echo("Files:<pre>");
var_dump($_FILES);
echo("</pre>");
?>
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.