Jump to:

23486 Posts in 18995 Topics by 2878 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: 3924 Views
  • jloafs
    Avatar
    Community Member
    15 Posts

    File is not a valid upload Link to this post

    I'm a new SS user, currently working with my first install of 2.4.4.

    I've come across a problem that, although there seems to be the odd reference to in the forum over the years, I can't see that anyone has solved yet.

    I'm completely unable to upload images through the CMS. Either through 'Pages' or 'Files and Images'.

    I can upload the the assets folder via FTP but I don't think my client's going to buy that.

    Anybody else had the same problem recently or know a fix?

    Cheers.
    Jloafs.

  • mmh
    Avatar
    Community Member
    24 Posts

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

    Is open_basedir active?
    If you don't know if it's active build an phpinfo.php (see below) and search for the string open_basedir.

    phpinfo.php:

    <?php
    phpinfo();

  • jloafs
    Avatar
    Community Member
    15 Posts

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

    Hi,

    I search for open_basedir with the following result:

    /nfs:/tmp:/usr/local:/etc/apache2/gs-bin

    Cheers.

  • mmh
    Avatar
    Community Member
    24 Posts

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

    Then open_basedir seems to be active. Read and try http://open.silverstripe.org/ticket/5547

  • jloafs
    Avatar
    Community Member
    15 Posts

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

    Thanks, I implemented the patches:

    cms-fileupload.patch

    sapphire-fileupload.patch

    upload-2.4.patch

    Uploaded them and did a dev/build with the error:

    Parse error: syntax error, unexpected T_IF, expecting T_FUNCTION in /nfs/c05/h03/mnt/74707/domains/everythingdesign.co.nz/html/test/silverstripe/cms/code/AssetAdmin.php on line 269

    Any ideas?

  • mmh
    Avatar
    Community Member
    24 Posts

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

    Yes, you've done something wrong (with the code...) ;-)

  • jloafs
    Avatar
    Community Member
    15 Posts

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

    Thought so.

    Are these the best of the patches to use? I notice there was a recent alternative patch too.

    Should I try to redo again from scratch?

    Hopeless I know.

    (I'm a graphic designer if you hadn't guessed)

  • mmh
    Avatar
    Community Member
    24 Posts

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

    This is "my" patch which is working for me.
    Folder.php and Upload.php are both located in sapphire/filesystem.

    Attached Files
    3924 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.