如何使用Fileupload控件上传一张图像并在图像控件中显示它而不需要保存它? [英] how I can Upload one image with Fileupload control and show it in image control without need save it?

查看:46
本文介绍了如何使用Fileupload控件上传一张图像并在图像控件中显示它而不需要保存它?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好.

如何使用Fileupload控件上传一张图像并在图像控件中显示它而不需要保存它? :doh:

:rose:

hi every one.

how I can Upload one image with Fileupload control and show it in image control without need save it? :doh:

thanks a lot of your help.:rose:

推荐答案

您不能.客户的Web浏览器需要请求该文件,为此,它必须存在于文件系统或DB中,并通过HTTP处理程序进行传递.

唯一的其他选择是IE给您提供文件的完整本地路径(但我认为firefox不会提供),因此您可以发送一个img标记,以从本地文件路径加载图像.但是,为什么要有人上传您不保存在任何地方的图片?
you can''t. Your client''s web browser needs to request the file, and for that, it has to exist, either on the file system, or in the DB and be delivered via a HTTP handler.

The only other option is that IE gives you the full local path to the file ( but I don''t think firefox does ), so you could send down an img tag that loads the image from the local file path. But why do you want someone to upload a picture you don''t save anywhere ?


我不知道如何使它变得更清晰,除了询问您为什么要进行显然将要使用的系统,并且可能正在付费?服务器上的上载控件至少在IE上具有本地文件的完整路径.因此,在IE中,您可以发送一个读取本地文件的标记.除了要再次声明确实没有办法解决所有浏览器的问题外,我不知道该说些什么.如果文件来自服务器,则需要保存.
I''m not sure how to make it clearer, except to ask why you are working on a system that is obviously going to be used, and probably is being paid for ? The upload control, on the server, has the full path of the file locally, on IE at least. So, in IE, you can send down a tag that reads the local file. I am not sure how to say it clear than that, except to state again that really, there is no way to solve your problem for all browsers. You need to save the file if it comes from the server.


这篇关于如何使用Fileupload控件上传一张图像并在图像控件中显示它而不需要保存它?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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