I have a button and a drag drop area. I want to apply valums file uploader to this button. But want to keep the drag drop area as another box besides it. How do I achieve it? My current implementation is as follows:
that.imageUploader = new qq.FileUploaderBasic({
button: $('#sprPictureUpload')[0],
action: '/ui/rest/utils/upload/image/file',
allowedExtensions:SUPPORTED_IMAGE_TYPES,
forceMultipart: true,
multiple: config.multiple,
inputName: 'photoFile',
onSubmit: function(id, fileName) {
renderImagePlaceHolders.call(that, id, fileName);
},
});
And the html looks like the following:
<section class="upload-section" data-section="upload">
<div class="upload-area">
<div style="">
<h3 style="color:#aaa">
Drag images here
</h3>
<h5 style="color:#aaa"> or if you prefer ...</h5>
<a id="sprGenericPictureUpload" class="btn btn-primary">
<i class="icon-upload icon-white"></i> Choose image to Upload
</a>
</div>
</div>
</section>
So what I would like is click on #sprPictureUpload
and drag anywhere in the .upload-area
section should initiate photo upload.
Also is there a way to apply uploader to two different elements with the same config?