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're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Upload broken in 2.4?


Go to End


55 Posts   16093 Views

Avatar
cyberde

Community Member, 10 Posts

5 September 2010 at 3:59am

I am having the exact same problem, so I checked out the latest 2.4 stable from SVN and tried that. No luck :(

My server has the open_base_dir thingy enabled (with PHP 5.2.14), so that might be causing the problems here since the files are being placed in my silverstripe-cache folder, but they aren't being moved to the assets folder though.

What are the exact patches one have to make in order to fix this issue? I've seen a lot of patches but which one is the best?

Cheers!

Avatar
charden

Community Member, 7 Posts

5 September 2010 at 6:00pm

Edited: 05/09/2010 6:01pm

Hello cyberde.

If you can disable open_basedir in your PHP-configuration you will be able to use the latest stable release of SilverStripe without modifications.

If not, you have to patch it, I recommend that you try this patch, it removes the unnecessary open_basedir hack/handling in AssetAdmin, which should solve your problem.

Good luck.

Avatar
cyberde

Community Member, 10 Posts

5 September 2010 at 9:28pm

Edited: 06/09/2010 3:52am

Unfortunately I'm unable to disable open_basedir since I'm on a shared hosting platform.
So I tried the patch, now I'm getting closer to getting it to work.

Now I'm getting a webpage error:

[Warning] move_uploaded_file(/home/cyberde/public_html/www/assets/Downloads/testfile.txt) [function.move-uploaded-file]: failed to open stream: Permission denied
POST /admin/assets/UploadForm
Line 248 in /home/cyberde/public_html/www/sapphire/filesystem/Folder.php

Update
Okay, I'm going to kick my own ass right now. After numerous checks I finally found out that the permission of a subfolder was set to 775 instead of 777. Pretty stupid!

Anyway the patch worked :D

Avatar
frankmullenger

Forum Moderator, 53 Posts

13 September 2010 at 2:25pm

Hey Danzzz,

Thanks a lot for this patch: http://open.silverstripe.org/attachment/ticket/5547/2.4.0-FileUpload.diff, worked for us too.

Cheers!

Avatar
amethystium

Community Member, 1 Post

29 September 2010 at 6:34am

Edited: 29/09/2010 6:42am

hi jseth,

make a copy of the 2 files showed in this file-diff:
http://open.silverstripe.org/attachment/ticket/5547/2.4.0-FileUpload.diff

then edit this 2 file as you see there -> green means add this code, red means remove this code

This patch worked for me.

daniel
_____________________________________________________________

Hello!
Thanks for the fix. It works for me in the 2.4.2 version.
But your code have error.
See my jpg file.

Attached Files
Avatar
jcsiegrist

Community Member, 1 Post

7 March 2011 at 11:57pm

Hmm, why hasn't the patch in http://open.silverstripe.org/changeset/114471 (3 months ago) been merged into the latest release?

The ticket in http://open.silverstripe.org/ticket/5547 has been marked fixed with the committed patch.

Are there issues with the patch? It seems to work just fine with us.

:jean-claude

Avatar
Celin Dion

Community Member, 1 Post

8 March 2011 at 2:33pm

I just did a fresh install of 2.4 RC1 and the upload just does not work. I have no clue what to do.help me.

__________________
watch online movies

Avatar
zyko

Community Member, 66 Posts

23 March 2011 at 10:47am

i did an update to 2.4.5
and - no Upload was working :-(

so i applied patch:
http://open.silverstripe.org/changeset/114471
and things are well now...

HINT: one thing to mention:
in GD.php
at last line there's

if(file_exists($filename)) @chmod($filename,0664);

i think this should be
Filesystem::$file_create_mask
instead