Jump to:

10851 Posts in 2517 Topics by 1793 members

All other Modules

SilverStripe Forums » All other Modules » Image Gallery upload error even with mod_security off?

Discuss all other Modules here.

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

Page: 1
Go to End
Author Topic: 1934 Views
  • Samba Sam
    Avatar
    Community Member
    85 Posts

    Image Gallery upload error even with mod_security off? Link to this post

    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

  • UncleCheese
    Avatar
    4085 Posts

    Re: Image Gallery upload error even with mod_security off? Link to this post

    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.

  • Samba Sam
    Avatar
    Community Member
    85 Posts

    Re: Image Gallery upload error even with mod_security off? Link to this post

    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

  • UncleCheese
    Avatar
    4085 Posts

    Re: Image Gallery upload error even with mod_security off? Link to this post

    Use:

    SWFUploadFieldConfig::debug();

    not

    SWFUploadField::debug();

  • Samba Sam
    Avatar
    Community Member
    85 Posts

    Re: Image Gallery upload error even with mod_security off? Link to this post

    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

  • UncleCheese
    Avatar
    4085 Posts

    Re: Image Gallery upload error even with mod_security off? Link to this post

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

  • ck_bullet
    Avatar
    Community Member
    16 Posts

    Re: Image Gallery upload error even with mod_security off? Link to this post

    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?

    1934 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.