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.

DataObjectManager Module

Discuss the DataObjectManager module, and the related ImageGallery module.

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

Image Gallery - upload fails to due to /tmp folder permsissions


Reply

16 Posts   3454 Views

Avatar
redactuk

27 May 2010 at 11:09pm (Last edited: 27 May 2010 11:10pm), Community Member, 117 Posts

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?

Avatar
UncleCheese

28 May 2010 at 2:18am 4085 Posts

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. :)

Avatar
redactuk

28 May 2010 at 3:27am Community Member, 117 Posts

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?

Avatar
redactuk

5 June 2010 at 3:03am (Last edited: 5 June 2010 3:07am), Community Member, 117 Posts

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.

Avatar
redactuk

8 September 2010 at 1:55pm (Last edited: 8 September 2010 2:28pm), Community Member, 117 Posts

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

Avatar
UncleCheese

8 September 2010 at 3:27pm 4085 Posts

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

Avatar
redactuk

8 September 2010 at 10:38pm (Last edited: 8 September 2010 11:28pm), Community Member, 117 Posts

"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?

Avatar
UncleCheese

9 September 2010 at 1:53am 4085 Posts

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

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