如何在不将图像文件上传到服务器的情况下在浏览器中显示图像预览? [英] How can I show a image preview in the browser without uploading the image file to the server?

查看:20
本文介绍了如何在不将图像文件上传到服务器的情况下在浏览器中显示图像预览?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的应用程序中,我希望当用户上传图像文件时,我想在提交表单之前立即向用户显示图像.这样他们就可以在提交表单之前预览图像.

In my application I want that when a user uploads an image file then I want to show the user the image immediately before submitting the form. This is so that they can preview the image before they submit the form.

在 HTML5 中,文件上传器是否可以在提交实际表单之前在客户端显示图像?

Is there any way in HTML5 that the file uploader can show the image on the client side before the actual form is submitted?

我想允许用户在不将文件上传到服务器的情况下预览图像文件(因此也没有上传到临时目录),但不知何故只是在客户端浏览器的客户端显示图像.

I want to allow the user to preview the image file without uploading the file to the server (so no uploading to the temp directory either), but somehow just show the image on the client side in the client browser.

推荐答案

HTML5 文件 API.

这篇关于如何在不将图像文件上传到服务器的情况下在浏览器中显示图像预览?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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