17488 Posts in 4473 Topics by 1978 members
| Go to End | Next > | |
| Author | Topic: | 3095 Views |
-
Upload large files fails with Undefined variable: status

2 December 2008 at 1:44am
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/UploadFormLine 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?
-
Re: Upload large files fails with Undefined variable: status

3 December 2008 at 2:06am
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.
-
Re: Upload large files fails with Undefined variable: status

3 December 2008 at 5:14am
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.
-
Re: Upload large files fails with Undefined variable: status

3 December 2008 at 5:38am
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.
-
Re: Upload large files fails with Undefined variable: status

3 December 2008 at 9:23pm
Ah.. hmmkay... Read your post a little too quickly there... ;-)
Tested and confirmed .. Same behaviour here...
-
Re: Upload large files fails with Undefined variable: status

9 December 2008 at 3:23am
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!
-
Re: Upload large files fails with Undefined variable: status

9 December 2008 at 3:38am
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> -
Re: Upload large files fails with Undefined variable: status

9 December 2008 at 3:47am
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.
| 3095 Views | ||
| Go to Top | Next > |


