Browse Source
Asset Manager Upload / Store file Limit (#2227)
Asset Manager Upload / Store file Limit
pull/2253/head
Artur Arseniev
7 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
15 additions and
1 deletions
-
src/asset_manager/config/config.js
-
src/asset_manager/view/FileUploader.js
|
|
|
@ -100,5 +100,14 @@ export default { |
|
|
|
modalTitle: 'Select Image', |
|
|
|
|
|
|
|
//Default placeholder for input
|
|
|
|
inputPlaceholder: 'http://path/to/the/image.jpg' |
|
|
|
inputPlaceholder: 'http://path/to/the/image.jpg', |
|
|
|
|
|
|
|
//method called before upload, on return false upload is canceled.
|
|
|
|
// @example
|
|
|
|
// beforeUpload: (files) => {
|
|
|
|
// // logic...
|
|
|
|
// var stopUpload = true;
|
|
|
|
// if(stopUpload) return false;
|
|
|
|
// }
|
|
|
|
beforeUpload: null |
|
|
|
}; |
|
|
|
|
|
|
|
@ -108,6 +108,11 @@ export default Backbone.View.extend( |
|
|
|
uploadFile(e, clb) { |
|
|
|
const files = e.dataTransfer ? e.dataTransfer.files : e.target.files; |
|
|
|
const { config } = this; |
|
|
|
const { beforeUpload } = config; |
|
|
|
|
|
|
|
const beforeUploadResponse = beforeUpload && beforeUpload(files); |
|
|
|
if (beforeUploadResponse === false) return; |
|
|
|
|
|
|
|
const body = new FormData(); |
|
|
|
const { params, customFetch } = config; |
|
|
|
|
|
|
|
|