close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

zip files

Thread began 4/05/2012 8:59 am by i.edwards384429 | Last modified 4/10/2012 11:30 am by Jason Byrnes | 3180 views | 13 replies |

i.edwards384429

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

Sign in to reply to this post

i.edwards384429

found reason

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

Sign in to reply to this post

Ian S

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

Sign in to reply to this post

Jason ByrnesWebAssist

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

Sign in to reply to this post

i.edwards384429

update

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

Sign in to reply to this post

Jason ByrnesWebAssist

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

Sign in to reply to this post

i.edwards384429

update

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

Sign in to reply to this post

i.edwards384429

update

That issue is solved found an error in the PHP - impressed myself!!!

Now to try the time limit code

Ian

Sign in to reply to this post

i.edwards384429

update

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

Sign in to reply to this post

Jason ByrnesWebAssist

judging by the content of the debug info, it sounds like are using a variable dump of the FILES array;


php:
<?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:
<?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:
<?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>");
?>
Sign in to reply to this post
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

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.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...