Jump to:

23023 Posts in 11882 Topics by 2830 members

General Questions

SilverStripe Forums » General Questions » File is not a valid upload

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

Page: 1 2 3
Go to End
Author Topic: 3619 Views
  • jloafs
    Avatar
    Community Member
    15 Posts

    Re: File is not a valid upload Link to this post

    Hey mmh,

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

    Thanks heaps for your help.

  • jloafs
    Avatar
    Community Member
    15 Posts

    Re: File is not a valid upload Link to this post

    Worked perfectly! Thanks heaps mmh.

  • mmh
    Avatar
    Community Member
    24 Posts

    Re: File is not a valid upload Link to this post

    No problem (:

  • Funfair77
    Avatar
    Community Member
    49 Posts

    Re: File is not a valid upload Link to this post

    Brilliant! Thank you for your help.

  • DsX
    Avatar
    Community Member
    178 Posts

    Re: File is not a valid upload Link to this post

    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?

  • Josua
    Avatar
    Community Member
    86 Posts

    Re: File is not a valid upload Link to this post

    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

  • Funfair77
    Avatar
    Community Member
    49 Posts

    Re: File is not a valid upload Link to this post

    I don't know.

    Marnix

  • Josua
    Avatar
    Community Member
    86 Posts

    Re: File is not a valid upload Link to this post

    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

    3619 Views
Page: 1 2 3
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.