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.

DataObjectManager Module /

Discuss the DataObjectManager module, and the related ImageGallery module.

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

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


Go to End


16 Posts   5173 Views

Avatar
redactuk

Community Member, 117 Posts

27 May 2010 at 11:09pm

Edited: 27/05/2010 11:10pm

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

Forum Moderator, 4102 Posts

28 May 2010 at 2:18am

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

Community Member, 117 Posts

28 May 2010 at 3:27am

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

Community Member, 117 Posts

5 June 2010 at 3:03am

Edited: 05/06/2010 3:07am

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

Community Member, 117 Posts

8 September 2010 at 1:55pm

Edited: 08/09/2010 2:28pm

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

Forum Moderator, 4102 Posts

8 September 2010 at 3:27pm

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

Community Member, 117 Posts

8 September 2010 at 10:38pm

Edited: 08/09/2010 11:28pm

"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

Forum Moderator, 4102 Posts

9 September 2010 at 1:53am

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

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

Go to Top