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

File is not a valid upload


Go to End


23 Posts   7291 Views

Avatar
jloafs

Community Member, 15 Posts

24 January 2011 at 10:54am

Hey mmh,

Just tried the very latest of those patches and hey presto!

Thanks heaps for your help.

Avatar
jloafs

Community Member, 15 Posts

24 January 2011 at 4:00pm

Worked perfectly! Thanks heaps mmh.

Avatar
mmh

Community Member, 24 Posts

24 January 2011 at 7:09pm

No problem (:

Avatar
Funfair77

Community Member, 49 Posts

7 October 2011 at 12:27am

Brilliant! Thank you for your help.

Avatar
DsX

Community Member, 178 Posts

25 October 2011 at 11:30am

I'm having the same problem with an install of 2.4.6
This is not my first Silverstripe install and I have got this working with other installs on this server (some time ago so how is unclear).

Has this patch not made its way into the distribution yet? Or am I looking at another problem?

Avatar
Josua

Community Member, 87 Posts

13 January 2012 at 3:25am

I installed 2.4.6 and I have this problem.
What can be happening?

VPS CentOS Plesk 10

dominiox.com/conf
File vhost.conf:

<Directory /var/www/vhosts/dominiox.com/httpdocs>
<IfModule mod_php5.c>
php_admin_value open_basedir "/var/www/vhosts/dominiox.com/httpdocs:/tmp:/usr/yii:"
</IfModule>
</Directory>

Thanks.

Regards,

Jose A

Avatar
Funfair77

Community Member, 49 Posts

13 January 2012 at 3:50am

I don't know.

Marnix

Avatar
Josua

Community Member, 87 Posts

13 January 2012 at 3:53am

Edited: 13/01/2012 3:55am

The problem occurs in the following lines (Upload.php):
public function validate() {
// we don't validate for empty upload fields yet
if(!isset($this->tmpFile['name']) || empty($this->tmpFile['name'])) return true;

$isRunningTests = (class_exists('SapphireTest', false) && SapphireTest::is_running_test());
if(isset($this->tmpFile['tmp_name']) && !is_uploaded_file($this->tmpFile['tmp_name']) && !$isRunningTests) {
$this->errors[] = _t('File.NOVALIDUPLOAD', 'File is not a valid upload'); <<<<<<<<<<<<<<<<<<<<
return false;
}

$this->tmpFile['tmp_name'] = /var/www/vhosts/dominiox.com/httpdocs/silverstripe-cache/bar1111.jpg
$isRunningTests = false

Apparently is_uploaded_file = false
Why?

Regards,
Jose A