Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » Upload large files fails with Undefined variable: status

Our old forums are still available as a read-only archive.

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

Page: 1 2
Go to End
Author Topic: 3487 Views
  • LesC
    Avatar
    Community Member
    70 Posts

    Upload large files fails with Undefined variable: status Link to this post

    Hi,

    I just mentioned this in the IRC room, but my IRC client is playing silly beggars today and keeps disconnecting, so before I write a support ticket I hoped someone might see this one.

    I'm trying to test the upload functionality of SS, and have come across a bug with uploading of large files.

    I'm running the new 2.3.0 RC2 install and everything else seems to be working fine - images under 2Mb will upload with no issues.

    When upload is clicked on a large file (say 5Mb), the iframe with the upload function shows an error page:

    [Notice] Undefined variable: status
    POST /admin/assets/UploadForm

    Line 225 in /cms/code/AssetAdmin.php

    It appears that line 225 is trying to test against the 'status' variable, then display a 'nothing to upload' status message:

    } else if($status != 'bad') {
    $statusMessage = _t('AssetAdmin.NOTHINGTOUPLOAD','There was nothing to upload');
    $status = "";
    }

    I know that my php install is set to allow up to 2Mb files, and don't want to be changing that right now. The CMS should be giving the user a proper error telling them that nothing was uploaded.

    Anyone know how to get round this so that it fails nicely if it has to fail at all?

  • LesC
    Avatar
    Community Member
    70 Posts

    Re: Upload large files fails with Undefined variable: status Link to this post

    Could someone else who is running 2.3 RC2 have a try at uploading a large file to their install?

    I've logged it as a ticket in the bug system anyway - it's kind of a blocker for me to be able to release to a client when it does this.

  • Fuzz10
    Avatar
    Community Member
    787 Posts

    Re: Upload large files fails with Undefined variable: status Link to this post

    Hi Les..

    Tried a big image upload. (3,5 mb)

    Works for me.

    I have my PHP max-file-size limit set up way high though.

  • LesC
    Avatar
    Community Member
    70 Posts

    Re: Upload large files fails with Undefined variable: status Link to this post

    Erm, thanks Fuzz10, but maybe I didn't make it clear:

    I can upload large files when I change the php.ini file, but only up to the maximum value set. Anything over that bails out with the error message I have issues with.

    If anyone can test this with a file larger than their php setting, it'd be much appreciated.

  • Fuzz10
    Avatar
    Community Member
    787 Posts

    Re: Upload large files fails with Undefined variable: status Link to this post

    Ah.. hmmkay... Read your post a little too quickly there... ;-)

    Tested and confirmed .. Same behaviour here...

  • LesC
    Avatar
    Community Member
    70 Posts

    Re: Upload large files fails with Undefined variable: status Link to this post

    Thanks for the confirmation Fuzz10 - I tried a fresh install this weekend and it's still doing the same thing.

    I'm going to start poking around in the code to see if I can fix this, but if there are any core team members out there that might be a bit more knowledgeable about this section and can help, then it would be much appreciated!

  • UncleCheese
    Avatar
    4085 Posts

    Re: Upload large files fails with Undefined variable: status Link to this post

    Maybe I'm being naive, but why are you expecting to successfully upload a file that exceeds the max_upload_size in your php.ini?

    For enhanced upload features, try out my SWFUpload extension. It automatically filters out files that are too large to upload.
    http://www.silverstripe.com/extending-hacking-silverstripe-forum/flat/229938
    </shamless plug>

  • LesC
    Avatar
    Community Member
    70 Posts

    Re: Upload large files fails with Undefined variable: status Link to this post

    Hi UncleCheese,

    Nice plug for SWFUpload (I'll take a look), but I'm not expecting a successful upload.

    What I am expecting is a user-friendly fail if they try to upload a large file - currently it shows a pretty crappy error that would completely stump the regular users of a CMS.

    And yes you can explain till you're blue in the face that the users need to only upload a file of a certain size, but they'll forget the moment you mention it.

    3487 Views
Page: 1 2
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.