j-PictureUploadExpert
- advanced usage
- drag and drop support
- supports
multiple - supports EXIF orientation
- multiple images are send one by one
- supports j-Loading
Configuration:
url {String}(IMPORTANT) upload URL (required)width {Number}a picture width (required)height {Number}a picture height (required)background {String}(optional) a background color (default: white)schema {String}prepared object for sending (default:{file:base64,filename:filename},base64+filenameis a value from preview)quality {Number}JPEG quality (default:90)customize {Boolean}resizes picture to the entire defined size (default:true)disabled {Boolean}disables image upload (default:false)clickselector {String}a class for custom click selector (default:none)dropselector {String}a class for custom drop selector (default:none)class {String}toggles class ondropselectorif the drag over is emitted (default:over)error {String}a path to methodmethod(err)when an error is thrown
Use it with <ui-component name="pictureuploadexpert">. When the component is not loaded yet, jComponent downloads it on first use from the address in DEF.fallback (the Componentator CDN by default). Author: Denis Granec. Source: the Componentator components repository, MIT license.
<style>
.dragdrop-message { margin-top:35px; text-align:center; font-weight:bold; }
.dragdrop-container { height:100px; background:#EFEFEF; border:2px dashed #CCC; border-radius: 2px; }
.over { border-color: #000 !important; }
</style>
<ui-component name="loading" class="hidden"></ui-component>
<div style="padding:50px;max-width:300px">
<ui-component name="pictureuploadexpert" path="pictures" config="width:200;height:200;url:/api/upload/base64/;dropselector:.dragdrop-container" class="link m">Click to upload</ui-component>
<div class="dragdrop-container m">
<div class="dragdrop-over">
<div class="dragdrop-message">Drop images here</div>
</div>
</div>
</div>
<script>
var pictures = [];
</script>