(function () { varCoverimage = Document.queryselector (' file '); //image CompressionCoverimage.onchange =function() {Lrz ( This. files[0], {width:640},function(results) {//The data you need is here, and can be sent as a string base64 to the
One, base64 picture codecBasic process: Download a picture from the network, then Base64 encoding, and then base64 decoding, stored in the local e-packing directory.
One, base64 picture codecBasic flow: Download a picture from the network. Then base64 encoding, and then base64 decoding, stored in the local e-packing folder.
When we are developing the system, it is unavoidable to deal with the uploading of images, and the way of uploading using thinkphp is certainly familiar import("@.ORG.UploadFile"); .Today we're going to talk about a way to upload pictures using HTML5
JavaScript converts a base64 image to formData and submits it through AJAX.
Previously, we used the webcam plug-in to take a photo. After taking the photo, we got an image in base64 format. It's okay to directly display it. Just specify it in src,
HTML5 JS compresses the image and obtains the BASE64 encoding of the image for upload,
Basic Process
1) Call reader. readAsDataURL (img) of FileReader to read the selected Image in the onload event.
2) In the onload event of the image object, use
not successful, but there is a certain reference/*** @param base64codes* Base64 encoding of images */function Sumitimagefile (base64codes) {//debuggerConsole.log (Convertbase64urltoblob (base64codes));var formData = new FormData (); The other
In order to take photos of the use of webcam-related plug-ins, its shooting is the base64 format of the picture, direct display no problem, in the SRC directly specified on it, but to upload to the server when the problem comes, the server side
One, des encryption:First, the web search for a DES encryption algorithm tool class:Import java.security.*;Import javax.crypto.*;public class Deshelper {private static String Strdefaultkey = "national";Private Cipher encryptcipher = null;Private
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.