Jump to content

wireupload custom errors


Frank Vèssia
 Share

Recommended Posts

The ones you are most likely to encounter are translatable from /wire/core/Upload.php

There is some other English text in there, but that is mostly for developer use and debugging/testing, so didn't think it needed to be translatable. Though let me know if you find something that should be. 

Link to comment
Share on other sites

  • 3 weeks later...

Hi ryan,

When one sets the max upload value with the hidden MAX_FILE_SIZE, then the message "Exceeds max allowed file size" never appears.

The error UPLOAD_ERR_FORM_SIZE get's caught already on the first line of the WireUpload::isValidUpload method.

If we don't put a MAX_FILE_SIZE field, it works.

But I remember having read somwhere that when setting the MAX_FILE_SIZE field and the user submits a bigger file, then it is not getting uploaded at all which I think is important.

I should have a translation too :)

Maybe moving the initialization of $errorInfo to the constructor, allowing to translate the strings?

Or provide a method to get also the error-keys, not only the strings?

Thanks :)

<?php
//When MAX_FILE_SIZE is sent and the file is too big, it get's caught on this line
if($error && $error != UPLOAD_ERR_NO_FILE) $this->error($this->errorInfo[$error]);
  • Like 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...