Documentation
API / Upload
This method allows you to upload files directly to the specified path. It also enables you to get the path and urls to those uploaded files.
Parameters
| Name | Description |
|---|---|
| path | Public file system path to upload files to. |
| onopen | Fires after the dialog has been opened. Can be used to produce a custom throbber. |
| onupload | Callback that gets executed when files are uploaded. |
| relative_urls | If this option is set to true, all URLs returned from the MoxieManager will be relative from the specified document_base_url. This option is set to false by default. |
| document_base_url | Document base URL defaults to the current page. This is the point relative URLs will be relative to. |
| remove_script_host | Enables you to remove scheme/protocol and host name from urls produced. |
| upload_auto_close | Automatically closes the upload dialog if all files where successfully uploaded. Disabled by default. |
Example
moxman.upload({
path: '/files/images',
onupload: function(args) {
console.log(args.files);
}
});