A small example of how to display a picture when uploading a user image is recently done. On the internet to find a lot of information also failed to achieve, if, with jquery, HTML5, realized, because the development is in the Linux so failed to test under IE, under Forefox,chrom is possible.One, the code under the HTML is: Second, jquery JS code: Different b
jquery verification upload picture with size verification and picture preview effect*/
function Submit_upload_picture () {
var file = $ (' File_c '). Value;
if (!/. ( gif|jpg|jpeg|png|gif|jpg|png) $/.test (file)) {
Alert ("Picture type must be one of the. Gif,jpe
. Uploaddiy is developed with jquery, then we have to apply jquery before we can use uploaddiy so pay attention to the priority when using JS
followed by the core HTML code
It's written in a table on form.
Then we start to complete the interface code for the control that we need to complete as follows:
Uploadify custom settings for the plug-in $ (document). Ready (function () {$ ("#uplo
Search on the Internet, found that the jquery+ajax way to achieve a single picture upload code is some, but to achieve a lot of upload pictures of the program but did not search, so according to the search code, wrote a can bulk upload.Look at the effect chart first
Clicking on the Add button will add a selection bo
This article introduces the avatar cutting upload function, the technology used has JQUERY,SPRINGMVC, the cutting plug-in uses is Jcrop (in the middle encounters many pits, finally crosses).
Picture upload step:
1. User Select picture
2. The
,string phonenum) {Boolean flag = false;String Licencepath = "";//Document photo upload after successful path savedCustcheckinfo = Customerservice.getcustomercheckinfo (Cust_tax_code, phonenum);Licencepath = Custcheckinfo.gettax_regist_cert ();To determine if the document path is not empty and exist in the uploaded folder, it indicates that the upload was successfulFile F = new file (Licencepath);if (Licenc
Online many Ajax jquery upload images to use the Submit button, how to upload and see directly on this page when users click on the div? Life and death problems, more Mr. Chia.
click me to pass the photo to upload.php
Reply content:
Online many Ajax jquery
Let's take a look at a php+jquery Ajax asynchronous upload image (Ajaxsubmit) instance, which we really use Ajax instead of using IFRAME and the like.
The effect is as follows
The code is as follows
Copy Code
index.php filePHP in conjunction with jquery asynchronous upload
JQUERY:[1] Implement picture upload and preview the idea of the principle1. Gets the URL of the image object to upload when input of the uploaded object is triggered and the local image is selected;2. Assign the object URL to the SRC attribute of the implementation-written IMG tagFile Object The file object can be use
case of absolute or relative positioning. And here, No.
So use the way to change the Margin-top margin-left value.
Three, move the formula
Above: Black: Picture, White: Selection, Red: Starting point, green: the horizontal ordinate value of the starting point; Yellow: Margin-top,margin-left of the right picture
Suppose: The picture on the left and the righ
One, the picture uploads realizes the local preview
Because the upload image function, now most need to implement the preview in the local, in order to be able to better let the user experience the effect, achieve the proof of the finished product, need to be compatible with several kinds of browsers, all through each example integrated this example plug-in, compatible with Firefox, Google, IE8, others ha
html code class = "Form-group" > for = "pic" class = "Col-md-1 C Ontrol-label "> Small figure:class =" Col-md-4 "> L T;input type= "file" class = "Form-control" name= "pic"/> class = "Progress" >class = "Bgpro" > = "Pic_show"/> CSS code . Progress { width: 100%; Height:10px; Border#CCC; margin:3px 0;}. Bgpro { display:block; Width: 1%; Background:Green; Height:10px; Color:#FFF;} JS CodeCan further beautify, for example, wearing the wrong, you can do an AJAX d
Upload picture preview, support IE6, IE7, IE8, IE9, IE10, IE11. Firefox, Chrome is not specifically tested, but the high version is supported.
Imgpreviewqs.js
/*! Relies on JQuery 1.5.2 (c) 2016 license:http://www.opensource.org/licenses/mit-license.php/(function ($) {$.fn.imgprevie WQS = function (options) {function Isie (ver) {var b = document.createeleme
Front Desk: upload.htm
Copy Code code as follows:
Confirm Upload Cancel Increase Picture 1:
Handler Handler.ashx
Copy Code code as follows:
Using System;
Using System.Web;
Using System.IO;
Using System.Text;
Using System.Net;
public class Handler:ihttphandler
{
public void ProcessRequest (HttpContext context)
{
SOURCE Picture
First say IE9, click Upload, the browser will prompt to download content.cause : IE9 and the following upload file of the response header contenttype if it is JSON, the browser will think it is a file download.Processing Method : Find backstage GG, change contenttype to text/html.Then modify the Done method to get the addressfunction (E, data) { var result = data.result[0].body? data.result[0].body.inner
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.