Jump to:

7939 Posts in 1472 Topics by 944 members

DataObjectManager Module

SilverStripe Forums » DataObjectManager Module » Uploadify: "HTTP Error"

Discuss the DataObjectManager module, and the related ImageGallery module.

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

Page: 1 2
Go to End
Author Topic: 10627 Views
  • UncleCheese
    Avatar
    4085 Posts

    Uploadify: "HTTP Error" Link to this post

    Hey, everyone,

    Well, we all know how annoying this error can be, and I thought I'd share some possible fixes. First, let's clarify why this happens.

    Uploadify uses a Flash object to handle the uploading of a file, and then copies the file to the server by invoking a PHP script. When errors happen executing that HTTP request to the PHP script, we don't get much to go on. Flash can only really tell us that the server came back with an error code (not 200).

    To help debug, you can use UploadifyField::show_debug(); in your _config.php. This will not only show you how the Uploadify widget is configured, but also force some text into the server response so that you can get more than just a 500 code if something fails, and it will show that text in an alert box. This doesn't always work, however, especially if the error happens before the controller is executed.

    Here are some tips on troubleshooting:

    1) Make sure error reporting is cranked up, and that "display_errors" is on in php.ini

    2) Download Charles or Wireshark (I like Charles) to packet sniff the server response. With a little bit of digging, you should be able to get the response and see an error.

    3) If you get a 400 code (bad request), chances are you have mod_security running, and it might be set a little too paranoid. You can talk to your sysadmin to either turn it off, or better yet, turn it down to be more tolerant of Flash requests.

    4) If you get a 302 (redirect) response, it means Flash didn't carry over the session through PHPSESSID, and you're therefore not authenticated in the CMS to do the upload. This is the most common and most troubling result, but I have managed to fix this on three separate occasions with the same fix:

    If you are on Rackspace "cloud" hosting

    This can help you. You need to change your session.save_path setting.

    First, find out your document root, using Director::baseFolder(); It should look something like this:

    /mnt/stor1-wc1-dfw1/534534/23234/your_site.com/...

    Create a directory at the same level as your_site.com called "sessions". It should be ABOVE the web root.

    Add this to your .htaccess:

    php_value session.gc_probability 1
    php_value session.gc_divisor 100
    php_value session.gc_maxlifetime 3600
    php_value session.save_path /mnt/xxx/xxx/xxx/your_site.com/sessions

    Where the "xxx" is for you to fill in according to your actual document root.

    Who knows why, but for some reason, Rackspace cloud hosting has very weird session handling with Flash.

    Feel free to add any of your own solutions below!

  • xini
    Avatar
    Community Member
    8 Posts

    Re: Uploadify: "HTTP Error" Link to this post

    Hi UncleCheese,
    I actualy get either no response (Remote server closed the connection before sending response header) or a 406 Not Acceptable (Client browser does not accept the MIME type of the requested page) uploading jpg files with the ImageUploadField.
    As client Charles shows "Shockwave Flash" as the user agent.
    I am using silverstripe 2.4.5 and just upgraded DOM and uploadify to the latest releases (not to the current trunk though).
    Do you have any idea what the problem could be here?
    Thank you very much.

  • Maariak
    Avatar
    Community Member
    20 Posts

    Re: Uploadify: "HTTP Error" Link to this post

    What should I do with response code "403 Forbidden"...? It says "You don't have permission to access /xxx/admin/EditForm/field/AudioFiles/UploadifyForm/field/UploadedFiles/upload
    on this server"

  • Maariak
    Avatar
    Community Member
    20 Posts

    Re: Uploadify: "HTTP Error" Link to this post

    And I'm wondering the thing, that there's actually no folders with that path in my xxx-folder, no folder called admin and those folders under it. Do I have something in wrong folder?

  • Maariak
    Avatar
    Community Member
    20 Posts

    Re: Uploadify: "HTTP Error" Link to this post

    Still wondering this problem. And I can't upload files through Files & Images either, the same HTTP error appears.

  • okotoker
    Avatar
    Community Member
    39 Posts

    Re: Uploadify: "HTTP Error" Link to this post

    I am having the same 403 error and cannot find the folders either. Did you figure this out?

    **Solved but with question

    I googled about mod_security I found this to add to my .htaccess file and everything went ok.
    <IfModule mod_security.c>
    ###########################################
    # disable POST processing to not break multiple image upload

    SecFilterEngine Off
    SecFilterScanPOST Off
    </IfModule>

    However my question as I don't know much about this module to know if disabling this is a good idea? What are the potential consequences?

  • Maariak
    Avatar
    Community Member
    20 Posts

    Re: Uploadify: "HTTP Error" Link to this post

    I've tried that aswell, and the "HTTP error" doesn't appear after trying to upload a file, but also there's no file in "Attached files" below and it does nothing when I push Continue, so I have to just close the window with Close button (that's in Audiopage I created). In Files & Images I can upload a mp3-file, "HTTP error" text doesn't appear, but it doesn't show any attached files below. But when I push the Close button to close the window, uploaded file does appear to the filelist. So can I somehow add a file uploaded from Files&Images to my Audiopage? Well of course it would be better to get this problem solved to make it possible to upload a file directly from Audiopage..

  • Maariak
    Avatar
    Community Member
    20 Posts

    Re: Uploadify: "HTTP Error" Link to this post

    I've tried different browsers before, but now I got audiofile to my Audiopage with Mozilla, when I uploaded the file with Upload new -tab, and when it doesn't appear to attached files, I opened Choose existing -tab, and the file was in the list, and importing from there got the file attached.. So attaching problem isn't solved, have to search other topics about that subject, the "HTTP error" isn't bothering anymore.

    But I would also like to know the answers to okotokers questions about the consequences.

    10627 Views
Page: 1 2
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.