Home > Web Front-end > HTML Tutorial > About image upload_html/css_WEB-ITnose

About image upload_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 11:43:33
Original
1016 people have browsed it

I made a function to upload and cut preview images, but I first uploaded a picture locally to an iframe, and then cropped it. After cropping, there is a small box on the right to display the crop preview. I want to click " When confirming the "Crop" button, submit the cropped image directly to the server, but I don't know how to submit it~ Just submit the image on the right side of the image to the server


Reply Discussion (Solution)

Use a form to submit, and action to the address you want. It is recommended that Baidu html form

input type="image" submit the form and take the image coordinates to the server to take a screenshot

Your main image has been uploaded to the server. When you crop, you only need to submit the rectangular information to the server, and then the server uses the main image for cropping. There is no actual cropping on the browser side. Picture

I found that the picture on the right actually only shows a part of the large picture and has not been cropped, but I am going to upload the picture on the left. The request does not contain a multipart/form-data or multipart/mixed stream , content type header is null This is a servlet, the underlined sentence reports an error.
Use ajax to pass
This is a form
Why does this error occur? ? How to solve it?

Your form is submitted in binary format, so it definitely cannot be uploaded using ordinary $.ajax?
Use jquery.form.js to refresh it?
http://jquery.malsup.com/form/#file-upload

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template