使用图像点击上传图像,而无需浏览选项文件上传 [英] Upload image using Image Click without Browse option file upload

查看:63
本文介绍了使用图像点击上传图像,而无需浏览选项文件上传的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用图像上传文件.在许多网站上,我看到都是在图片上单击,而不是浏览文件上传.
我尝试这样做,但无法这样做

任何帮助
提前谢谢.

Suraj Prakash

I want to use image for file upload. In many website I saw that on image click instead of the Browse file upload.
I tried to do so but unable to do so

Any Help
Thanks in advance.

Suraj Prakash

推荐答案

单击图片,而不是浏览文件上传
这是窍门.在页面上保留文件上传控件,但将其显示属性设置为隐藏.现在,在图像上单击,通过客户端调用文件上传浏览按钮. (如果需要,您可以动态创建控件并调用).这样,在单击图像时,浏览文件弹出窗口就会出现,您可以选择它.
on image click instead of the Browse file upload
Here is the trick. Keep a File-upload control on the page but set it''s display property as hidden. Now, on image click, via client side invoke the file-upload browse button. (If you want you can dynamically create the control and invoke). This way, on click of image, the browse file popup would come and one can select it.


您是否要尝试在没有文件上传控制的情况下上传和图像?如果是这样,那是不可能的.如何在客户端上指定文件?即使您可以设置要上传的文件,这也将是一个巨大的安全漏洞.想象一下某个网站尝试在您不了解的情况下从您的计算机加载文件.

您需要上传文件才能上传文件.
Are you trying to upload and image with out file upload control? If so, that is not possible. How can you specify the file on the client? Even if you can set the file you want to upload, that would be huge security hole. Imagine some website try to load file from your machine with out your knowledge.

You need file upload in order to upload a file.


非常感谢 ans 谢谢寻求帮助


这篇关于使用图像点击上传图像,而无需浏览选项文件上传的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆