Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

All other Modules /

Discuss all other Modules here.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Image Gallery upload error even with mod_security off?


Go to End


7 Posts   2947 Views

Avatar
Samba Sam

Community Member, 85 Posts

31 October 2009 at 12:16pm

Edited: 31/10/2009 12:17pm

Hi,
When I go to upload images to my Image Gallery module album in the CMS I get the "server did not accept" error.

I called Bluehost, my web host, and they claim that mod_security is not enabled by default for their clients (ie., it's off).

I also added the following to my htaccess file in the root of the domain with no luck:

<IfModule mod_security.c>
SecFilterEngine Off
SecFilterScanPOST Off
</IfModule>

Any ideas?
Sam

Avatar
UncleCheese

Forum Moderator, 4102 Posts

31 October 2009 at 12:42pm

The other thing that's been coming up lately that you might want to look into is PHP safe mode being enabled. That can't be on, otherwise the PHP copy() function fails.

Try the method in the Troubleshooting section of the SWFUploadField documentation and see which line is causing the error, or if you're more technical, use Wireshark to packet sniff and get the error that the server is reporting.

Avatar
Samba Sam

Community Member, 85 Posts

2 November 2009 at 10:28pm

Edited: 02/11/2009 10:34pm

Hi,
Thanks for your quick response. The safe_mode in my php.ini was off (that's what you are referring to, right?). So that's not the issue.

When I added
SWFUploadField::debug();
to mysite/_config.php file to start the SWFUploadField trouble shooting process as you suggested, I got a fatal error.

Do I also need to add
Director::set_environment_type("dev");
to mysite/_config.php? I'm I editing the wrong _config.php file?

Also does this look right for the starting insertion position of the die('hello') statement in the ImageGalleryManager.php file?

class ImageGalleryManager_Controller extends Controller
{
public function handleswfupload()
{ die('hello');
if(isset($_FILES['swfupload_file']) && !empty($_FILES['swfupload_file'])) {
etc....etc.....

Thanks,
Sam

Avatar
UncleCheese

Forum Moderator, 4102 Posts

3 November 2009 at 2:36am

Use:

SWFUploadFieldConfig::debug();

not

SWFUploadField::debug();

Avatar
Samba Sam

Community Member, 85 Posts

3 November 2009 at 8:43am

Edited: 03/11/2009 8:45am

Hi,
So the issue was with the htaccess file in the root directory of the SS domain.

The domain is underdevelopment so I password protected it through the cpanel.
Unbeknownst to me, it appended the following to the end of the SS htaccess file:

### SILVERSTRIPE END ###
AuthType Basic
AuthName "HolyBasil.info (underdevelopment)"
AuthUserFile "/home3/islandro/.htpasswds/public_html/holybasil/passwd"
require valid-user

Once I removed it. The SWFUpload in the Image Gallery module worked.

Thanks,
Sam

Avatar
UncleCheese

Forum Moderator, 4102 Posts

3 November 2009 at 9:25am

Yup. That's another common cause. Glad you flushed that out!

Avatar
ck_bullet

Community Member, 16 Posts

13 October 2010 at 8:40am

I would like to password protect the entire site using htaccess and htpasswd in the root, but as previously mentioned this breaks uploading. Is there a way around this?