Jump to:

7935 Posts in 1536 Topics by 943 members

DataObjectManager Module

SilverStripe Forums » DataObjectManager Module » Image Gallery - upload fails to due to /tmp folder permsissions

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: 3357 Views
  • redactuk
    Avatar
    Community Member
    115 Posts

    Re: Image Gallery - upload fails to due to /tmp folder permsissions Link to this post

    Question: Does any image_gallery process or related process need access to any other filesystem location other than any /assets/image_gallery album folder it creates?

  • UncleCheese
    Avatar
    4085 Posts

    Re: Image Gallery - upload fails to due to /tmp folder permsissions Link to this post

    Good question. In theory, no, it shouldn't, but I'm a little unclear on how the file upload process works in Silverstripe. It could very well be that files are dumped into a default location, and then, depending on the path specified in the Upload object, moved to their final destination.. but that would surprise me.

    The one thing you definitely want to make sure is writable is your upload temp dir in PHP. Usually outside of the web root... I've had a number of people experience weird things with file uploads because they never get saved to the server at all due to write errors. A good hosting provider would never let that happen, though.

  • redactuk
    Avatar
    Community Member
    115 Posts

    Re: Image Gallery - upload fails to due to /tmp folder permsissions Link to this post

    Sadly this client wanted to use their own hosting rather than mine.

    Regarding access to the temp folder, does anyone know the relationship between this and the silverstripe-cache folder? On this client's install silverstripe-cache is used as the main SS temp files cache, and it was my impression that the PHP temp folder outside the client's web root would only be used IF SS found silverstripe-cache was not present. Anyone know if this is true?

  • redactuk
    Avatar
    Community Member
    115 Posts

    Re: Image Gallery - upload fails to due to /tmp folder permsissions Link to this post

    For anyone else finding this thread later:

    Yes it was incorrect permissions on the PHP temp folder. Even though we had correct permissions in the silverstripe-cache folder and the assets folders, it would seem that the Upload object does make use of the PHP temp folder on the web server.

  • redactuk
    Avatar
    Community Member
    115 Posts

    Re: Image Gallery - upload fails to due to /tmp folder permsissions Link to this post

    This has happened yet again on a new client's system.

    UncleCheese can you help me here please?

    Is it a third party module called SWFUpload that handles uploading images via ImageGallery?

    What I want to know is WHY does the image upload process make suse of a /tmp folder outside of the user's area. My client's hosting provider is saying that this script is at fault and should be using a local temp folder.

    Thanks

  • UncleCheese
    Avatar
    4085 Posts

    Re: Image Gallery - upload fails to due to /tmp folder permsissions Link to this post

    Any upload over PHP needs to write to a temp folder, regardless of the component that instantiated the upload, whether Flash or your browser, or whatever. If that temp folder isn't writable, you'll get an error code. I don't think it has anything to do with SWFUpload because I've seen FileIFrameFields do the same thing. But if you're looking for things to try, I might switch to the Uploadify module, since it's more stable and secure than SWFUpload.

    ---------------
    Silverstripe tips, tutorials, screencasts, and more. http://www.leftandmain.com

  • redactuk
    Avatar
    Community Member
    115 Posts

    Re: Image Gallery - upload fails to due to /tmp folder permsissions Link to this post

    "Any upload over PHP needs to write to a temp folder"

    But why is the image upload not using the /tmp folder in the user's shared hosting root? The point web hosting providers are making is that this script should not need permission to any temporary folder used by PHP at the server level due to security.

    also "switch to the Uploadify module"

    I though SWFUpload was requirement for ImageGallery?
    How can I switch to Uploadify and will it provide same functionality?

  • UncleCheese
    Avatar
    4085 Posts

    Re: Image Gallery - upload fails to due to /tmp folder permsissions Link to this post

    More on Uploadify here: http://www.leftandmain.com/silverstripe-modules/2010/08/26/uploadify/

    --------------------
    SilverStripe tips, tutorials, screencasts and more: http://www.leftandmain.com

    3357 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.