PasteImgUpload
Description
Demo available at Jsfiddle:
https://jsfiddle.net/a703d2q3/1/
This recipe enables direct copy and paste to upload an image using Javascript AJAX. Images copied from the Internet, image editing tools, or an image file are all supported. A little animation is shown on upload success. The uploaded image is automatically given a filename being the formatted current time. The default markup for uploading is also automatically pasted with filled filename as Attach:YYYYMMDD_HHMMSS.png
. On upload failure, an alert message is shown with response sent from the server. Note that this recipe currently only works in Chrome.
Note that this recipe can work with DragDropMultiUpload. ( include it before DDMU.)
Installation
- Enable upload in local/config.php
$EnableUpload = 1;
- Download pasteimgupload.zipΔ
- Place
pasteimgupload.php
in your/cookbook/
directory, the/pasteimgupload/
dir with all files in your/pub/
directory. - Add to local/config.php this line:
include_once("$FarmD/cookbook/pasteimgupload.php");
Change log / Release notes
- 20160729 - first release.
Contributors
- Recipe written and maintained by LSMeng.
See also
Comments
See discussion at PasteImgUpload-Talk.
User notes? : If you use, used or reviewed this recipe, you can add your name. These statistics appear in the Cookbook listings and will help newcomers browsing through the wiki.