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.

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   20077 Views

Avatar
t00thy

Community Member, 31 Posts

6 May 2011 at 3:37am

Hi,

in SS 2.4.5 you can use it on the same line.
You need remove line 479 and 480 in Upload.php

This is the lines you need to remove

$isRunningTests = (class_exists('SapphireTest', false) && SapphireTest::is_running_test());
if(isset($this->tmpFile['tmp_name']) && !is_uploaded_file($this->tmpFile['tmp_name']) && !$isRunningTests) {

This is the changes i make to work.

Avatar
KoJans

Community Member, 14 Posts

4 July 2011 at 4:40am

Thanks Charden,

This patch worked for me in 2.4.5.

Ko

Avatar
MagicUK

Community Member, 60 Posts

13 July 2011 at 3:59am

I've just had the same problem. Silverstripe 2.4.5

I just applied the patch as per: http://open.silverstripe.org/attachment/ticket/5547/2.4.1-FileUpload-2.diff

I still get the error message. I've uploaded the images to my UPloads folder via FTP and then added them 'from the file store' that way. But what's weird now is that I see no thumbnail on the field. (see attached) Can this maybe point to another issue?

Avatar
MagicUK

Community Member, 60 Posts

18 July 2011 at 8:31pm

Edited: 18/07/2011 8:33pm

Can anyone help with my issue above. I'm working on a pretty job and this hindering me a lot. Can anyone suggest what the issue could be?

A few post back someone mentioned adding 'php_admin_value open_basedir none' to the vhost config file. I asked my server administer to do this and they gave me this response, but the CMS is still behaving the same:

The server is setup to support .htaccess level php controls. I've added "php_flag open_basedir none" to the .htaccess file located in the root directory. This should serve as you require.

The site im working on isn't located in the root directory. Would I need to add the line into the .htaccess file on the silverstripe directory for this to have an effect?

Any other suggestions on how I can get this issue sorted? Thanks so much.

Avatar
cheeks

Community Member, 4 Posts

19 July 2011 at 1:38am

hope you guys can help

i am using ss245

still cannot upload any files

my server log shows the following

=====================

PHP Warning: Unknown: open_basedir restriction in effect. File(/tmp) is not within the allowed path(s): (/opt/silverstripe) in Unknown on line 0
pHP Warning: File upload error - unable to create a temporary file in Unknown on line 0

=====================

i seem to have a " open_basedir " problem

any help greatly appreciated

Avatar
Bikerboy

Community Member, 3 Posts

23 April 2012 at 11:23pm

Version 2.4.7 also showing 'File not a valid upload' when I try and import images. If this problem is persistent then I won't be able to use SS for another site that I'm planning which would be a great pity.

(The attached image, if it shows, is a test to see if it uploads images to the forum)

Attached Files
Avatar
swaiba

Forum Moderator, 1899 Posts

24 April 2012 at 1:48am

Edited: 24/04/2012 1:48am

Ignoring that this thread is about 2.4.5 issues BikerBoy...

these are what has worked for me...

2.4.5 - http://open.silverstripe.org/attachment/ticket/5547/2.4.0-FileUpload.diff
2.4.7 - http://open.silverstripe.org/changeset/114471

Go to Top