filter:uploadImage and filter:uploadFile changes


  • Admin

    If you have any plugins that use filter:uploadImage or filter:uploadFile please read below on the changes coming in 0.6.0. If you have any questions about how to update to the new hooks please feel free to ask.

    filter:uploadImage

    filter:uploadImage used to take only a single parameter was either an object referencing an upload file or an object that had an url to a external image. The uid of the user uploading the image has been added.

    plugins.fireHook('filter:uploadImage', {image: image, uid: uid}, callback);

    or

    plugins.fireHook('filter:uploadImage', {image: {url: url}, uid: uid}, callback);

    See nodebb-plugin-imgur to see how to handle this hook

    filter:uploadFile

    Same as above the uid of the user making the upload has been added.

    plugins.fireHook('filter:uploadFile', {file: file, uid: uid}, callback);



  • This post is deleted!

Log in to reply
 


Star

Looks like your connection to NodeBB was lost, please wait while we try to reconnect.