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.

General Questions

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

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

File is not a valid upload


Reply

23 Posts   3965 Views

Avatar
jloafs

24 January 2011 at 10:54am Community Member, 15 Posts

Hey mmh,

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

Thanks heaps for your help.

Avatar
jloafs

24 January 2011 at 4:00pm Community Member, 15 Posts

Worked perfectly! Thanks heaps mmh.

Avatar
mmh

24 January 2011 at 7:09pm Community Member, 24 Posts

No problem (:

Avatar
Funfair77

7 October 2011 at 12:27am Community Member, 49 Posts

Brilliant! Thank you for your help.

Avatar
DsX

25 October 2011 at 11:30am Community Member, 178 Posts

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

13 January 2012 at 3:25am Community Member, 86 Posts

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

13 January 2012 at 3:50am Community Member, 49 Posts

I don't know.

Marnix

Avatar
Josua

13 January 2012 at 3:53am (Last edited: 13 January 2012 3:55am), Community Member, 86 Posts

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