News:

Bored?  Looking to kill some time?  Want to chat with other SMF users?  Join us in IRC chat or Discord

Main Menu

Your attachment couldn't be saved

Started by shawlw, March 23, 2014, 03:41:15 AM

Previous topic - Next topic

shawlw

Hi.

I am able to upload small PDF attachments, but when I get over 2MB it fails. I have tested with the same configurations on my local PC, and an attachment uploads immediately.

My php.ini is:
max_execution_time = 30
max_input_time = 60
memory_limit = 256M
upload_max_filesize = 256M
post_max_size = 30M
upload_tmp_dir =/home/xxxxxxx/public_html/php_tmp    (commented out part of the name here)
date.timezone = "Australia/Sydney"

Current SMF version: SMF 2.0.7

Is there a configuration file that addresses this, or is this a known issue? I have tried switching off security checks and file extensions, but as mentioned, no issue on my localhost when testing.

(I would like to have the forums up and running in public in about 2 weeks if possible.)

Many Thanks,
Laurie Shaw

Bobby

You can change size of attachment in ACP --> Attachments and Avatars Settings --> Attachment Settings --> Max size per attachment

shawlw

Hi,

I just tried setting to no maximum limit, using 0 setting. (I had not tried that before.) But it still would not upload. I notice that the upload can fail within 15 seconds, at at other times half a minute to a minute.

Laurie

Bobby

#3
Did you set PDF file type allowed to upload in "Allowed attachment extensions" setting? How about upload other types (doc, zip...) over 2MB? What's the error when upload fail?
Ok, you should try to increase the value in php.ini:
max_execution_time = 300
Restart server and try upload file again!

shawlw

Hi.

I just tried a 1.1MB JPG okay. And then tried a 2.2MB JPG, and it would not upload. It was rejected within 15 seconds. I have tried checking the box for or without extensions. When I do check the box, I have pdf listed:

The error message is:


An Error Has Occurred!
Your attachment couldn't be saved. This might happen because it took too long to upload or the file is bigger than the server will allow.

Please consult your server administrator for more information.

Thanks again.
Laurie

Bobby

Ok, you should try to increase the values in php.ini:
max_execution_time = 300
max_input_time = 300
Restart server and try upload file again!

shawlw

#6
Hi.

I made the change, but it would not upload the 2.2MB JPG file.

When you say restart the server, I cleared my browser history, quit Firefox, restarted it, and logged in fresh into the forum. I gather that is all that is required. (Same issue on Safari.)
I did a phpinfo.php script just to check, and the values show the change to 300 as you suggested, so that appears to be in place.

Thanks again.
Laurie

update: I did a fresh install of SMF into a /dev/forum directory, configured to use 0 on the attachment sizes, etc. and still had the same issue.
thanks - laurie


Bobby

Hi shawlw,
"Restart server" that means restart Apache server on your web server, you can read more here: http://webdesign.about.com/cs/apache/ht/htapacherestart.htm
Please try again and see if can work or not :-)

shawlw

Hi.

I am on a web hosted service. Would you suggest I give them a phone call tomorrow, and raise this issue with the 2MB limit with them. I am very happy to try that and discuss the request to restart apache server with them. It is almost 9pm at the moment. And then get back here to update.

Cheers,
Laurie

Bobby

Yes, and please tell me if it's ok or not tomorrow!

shawlw

#10
Will do. I'll get back in about 12 to 14 hours. Thanks for your help.

Cheers,
Laurie

update: I logged a ticket with the host provider, so it may be answered over night. It appears the issue is not the forum. I tried to upload a file > 2MB in Wordpress, and got an error message of maximum file size of 2MB reached. I will certainly get back here though with an answer on this. It is quite critical to be able to upload files > 2MB for documents on the forum, as well as upgrades to wordpress themes.

shawlw

Problem solved.
The host provider did something behind the scenes with php.ini. They removed my php.ini file in public_html/ directory where I was trying to increase memory limit. So whatever they did, it is working. They said not to touch anything with php.ini as it causes a 500 Internal Server error (which started to happen last night while they were making changes.)
All looks quite complex, but they solved it.
Thanks for you help. This is very appreciated.
Cheers,
Laurie

Bobby


Advertisement: