Get the type of an image file.
the absolute path to a file.
one of 'jpg', 'png' or 'gif' if valid; undefined if not.
whather the specified path is a valid picture
[read description]
the file contents as a string. Caller must parse JSON himself if needed.
Saves a file upload on a model. The picture will be resized (if needed) & moved, but model.save() won't be called. The file extension will be grabbed from the source path. If folders don't exist, they will be created. If there was a pre-exiting picture, it will be deleted.
The form field to save
Whether to delete the picture
The path to the destination, relative to the uploads folder
(Optional) allowed: maxDiagonal
result, with either "error" or "finalPath" set, or nothing if the picture was deleted
Saves an upload to the specified path, resizing it if needed in the process. The file extension will be grabbed from the source path. If folders don't exist, they will be created.
The form field to save, or the file path if this is not a form upload
The path to the destination, relative to the uploads folder
(Optional) allowed: maxDiagonal / maxWidth / maxHeight / fit / suffix / format). See presets: constants.PICTURE_OPTIONS_*
the URL to that path
Writes data to a file
Destination file
Contents to write. If a function, will be evaluated. If an object/array, will be stringified.
Generated using TypeDoc
Creates a folder. No-op if the folder exists. Does not make the folder relative to the file storage root.