Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Max file size limit and error message #49

Open
madisoft opened this issue Aug 24, 2013 · 1 comment
Open

Max file size limit and error message #49

madisoft opened this issue Aug 24, 2013 · 1 comment

Comments

@madisoft
Copy link

Hi,

is there a way to set max file size limit for uploads?

Also, is there a way to show the user a message if he has reached the limit?

Last question, is there a way to show the user a message if he has uploaded a not allowed file type extension?

Thanks

Matteo

@chkris
Copy link

chkris commented Feb 5, 2014

Yes, you can get the message after file upload with not allowed file type extension error. Documentation doesn't contain such information but you can put 'errorCallback' parameter while creating PunkAveFileUploader for example like that:

        new PunkAveFileUploader({
            'uploadUrl': {{ path('b2b_file_upload_supplier', { editId: uniqueId }) | json_encode | raw }},
            'viewUrl': {{ ('/uploads/tmp/attachments/' ~ uniqueId ) | json_encode | raw }},
            'el': '.file-uploader',
            'existingFiles': {{ punkave_get_files(('/tmp/attachments/' ~ uniqueId)) |  json_encode | raw }},
            'delaySubmitWhileUploading': '.edit-form',
            'errorCallback': function( info ) {
               //I just simply show information to user
                $('.allowed-file-extension').show();
            }
        });

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant