有没有办法把客户端页面上没有url的图片上传到服务器

WBOY
Release: 2016-06-23 13:31:56
Original
838 people have browsed it

我是要做一个图片裁剪的程序
我在网上看到的方法都是要将原图上传到服务器   
再用php自带的函数进行裁剪的   
我想问的是有没有办法   
不用上传原图
直接将在网页上预览的裁剪好的图片上传到服务器?
但是预览的图片是没有路径的 
有没有办法上传?
或者说有其他的方法可以达到不用上传原图的效果?
谢谢!!


回复讨论(解决方案)

虽然借助 Canvas.toDataURL 可以将裁剪后的区域发送出去
但 Canvas 也只能接受同源图片。
所以,你不想使用文件上传的话,是做不到的

还是按照通用的办法来吧,省事方便。

我决定用canvas来做

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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!