Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.
"Failed to upload" when uploading a picture?
blizeH
✭✭
Hi,
The file uploader built into our forum is temperamental, many photos (vast majority) won't upload - I think it's possible down to file size but have no way to verify it for sure.
In the php.ini file the maximum size is 20M so I don't think it's that.
Here's the error we get:
Any ideas please? Thank you!
0
Comments
Also when it does insert, it's tiny and a thumbnail you have to click on, not a nice inline image like that ^
Did you try watching it as you upload it, with developer browser console open? Click the Network tabs and the Console tabs and see what's happening during the upload.
As I'm fairly new on this forum, I can only give answers as to what works on most scripts. In a lot of cases, folder permissions come into play when things won't upload. JS conflicts can play a part (though I need more time playing with Vanilla to see how it uploads). I don't have a file uploader on my forum so it'll be a little harder to test things as we don't allow it for security reasons.
Is it in the advanced editor? Is it a plugin? Did you make something?
Perhaps one of the gurus here will know exactly what you are using. Til then, I'm just trying to help you troubleshoot.
Thank you very much! I'm on mobile right now but I'll check as soon as I can get on a PC.
I am using the built in editor (same upload photo feature as this forum too)
Based on more testing I'm 100% sure it's due to file sizes. Images below 2mb seem to upload fine but nothing bigger.
You are posting under vanilla 2.3. so I am guessing you have the editor version 1.7.7
Here is what I have found...
regarding:
If you using vanilla 2.3b1 - the beta version includes a version of the advanced editor that automatically inserts the image in the body of your message - IF you are not on a mobile device. If you are on a mobile device it does NOT seem to insert the image IIRC
I believe this inconsistency is the same with the editor that comes with 2.2.1. with editor 1.7.2
not sure if this will fix the problem in mobile - but you can try it.
https://vanillaforums.org/discussion/comment/238605/#Comment_238605
regarding file upload troubles - there are quite a few discussions regarding this and solutions:
if some uploads fail based on file size
some problems are regarding your config statements in config.php
some problems may be due to the settings in php
CHECK the php values regarding - each one has an impact.
ini_get('post_max_size');
ini_get('upload_max_filesize');
what is the value in your config.php for Garden.Upload.MaxFileSize. if you don't have the statement, It will be set to 50M by the default in config-defaults.php (which is sufficient).
https://github.com/vanilla/vanilla/blob/Vanilla_2.2.1/conf/config-defaults.php#L81
other problems with file sizes can be related to nginx configuration
if you are using nginx
http://stackoverflow.com/questions/4947107/nginx-upload-client-max-body-size-issue
adjust the client_max_body_size 1M;
to the size you want.
if pretty much all picture uploads fail
some problems are regarding gd - not installed when upgrading php - see phpinfo.
Test uploading a 2MB zip file vs. 2MB image file.
If both fail it is a size setting.
If one fails and the other doesn't it is probably a memory issue or a gd issue and NOT a folder problem and not a Garden.Upload.MaxFileSize or a client_max_body_size or a post_max_size or a upload_max_filesize.
ONLY If large image fails
AND very small image of same extension succeeds
AND zip succeeds
you may need to increase your memory_limit to 128M or higher that is allowed.
maximum size is not a variable! be specific when you can be.
are you are reading the correct php.ini ? check with phpinfo.
http://php.net/manual/en/function.phpinfo.php
Pragmatism is all I have to offer. Avoiding the sidelines and providing centerline pro-tips.
Thank you so much for the detailed reply!
I've just upgraded to the latest version - 2.2.1 - so I think I've posted this in the wrong category but I can't figure out how to change it.
In my php.ini file I have:
And I've just updated the following:
And now... I don't want to jinx it, but I think changing the memory limit has worked! Woooo Thank you so much
It's still displayed like this by the way:
Is it just a case of waiting for a stable 2.3 release, or is there something I can change in the mean time?
To fix the issue in vanilla 2.2.1, The easiest for you based on your questions and responses is
change this line 1210 in plugins/editor/js/editor.js from
You also need to be aware of this if you want things to function properly.
regarding your Input Formatters in config.php
Make sure if you want the image automatically inserted use one of these formats ('Wysiwyg', 'Html', 'Markdown', 'BBCode'). You CAN NOT use Text ot TextEx as the formats for the Desktop because it will not insert the image
$Configuration['Garden']['InputFormatter']
and Make sure if you want the image automatically inserted use one of these formats ('Wysiwyg', 'Html', 'Markdown', 'BBCode'). You CAN NOT use Text ot TextEx as the formats for the Mobile because it will not insert the image
$Configuration['Garden']['MobileInputFormatter']
Both of these setting are available from the Advanced Editor Settings page thru the dropdown boxes.
Make sure you reload the browser and anything that might cache your js, so the changes you make to the js will be reflected.
Pragmatism is all I have to offer. Avoiding the sidelines and providing centerline pro-tips.