how to access meta.config.maximumFileSize in plugin client side js?

Plugin Development
  • #1

    Hi.

    Since nodebb-plugin-composer-redactor don't listen to meta.config.maximumFileSize and I need to restrict this a bit
    I've modified redactor.js to this:
    traverseFile: function(file, e) {
    var maxFileSize = 1500 * 1024;
    if(file.size > maxFileSize){
    this.modal.close();
    this.selection.restore();
    this.core.setCallback('fileUploadError', 'file-size-error'); //needed?
    return app.alertError('[errormessage]',20000);
    }

    Is there a simple way to make maxFileSize contain the meta.config.maximumFileSize value instead?

  • NodeBB
    #2

    It is available in the client side config object. You can use it as config.maximumFileSize


Suggested Topics

  • 0 Votes
    2 Posts
    35 Views

  • 0 Votes
    6 Posts
    413 Views

  • 1 Votes
    3 Posts
    798 Views

  • Best way of forking a plugin?

    Unsolved Plugin Development
    0 Votes
    2 Posts
    1223 Views

  • 0 Votes
    4 Posts
    2354 Views

| | | |