在不打开对话框的情况下读取本地文件(在浏览器中) [英] Read local file without open dialog (in browser)

查看:102
本文介绍了在不打开对话框的情况下读取本地文件(在浏览器中)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有什么方法(通过浏览器)无需打开对话框即可读取本地文件?

There is any way (from browser) to read local file without open dialog?

可以使用:javascript,flash或java.

Can be used: javascript, flash, or java.

目标:将带有MS Word中图像的文字粘贴到所见即所得中时,将有指向图像文件的链接.就像"file:///C:/Users/username/AppData/Local/Temp/msohtmlclip1/01/clip_image001.jpg".我想读取此文件,上传到服务器并替换本地路径.

Goal: when you paste text in WYSIWYG with images from MS Word, there will be links to image files. Like "file:///C:/Users/username/AppData/Local/Temp/msohtmlclip1/01/clip_image001.jpg". I want to read this files, upload to server and replace local path.

推荐答案

在未经用户许可的情况下从浏览器访问磁盘内容存在安全风险.因此,要使用Java进行此操作,您需要对小程序进行签名并允许用户运行它.

Accessing the disk contents from the browser without the user permission is a security risk. As such, to do that with Java you need your applet signed and the user allowing it to run.

这篇关于在不打开对话框的情况下读取本地文件(在浏览器中)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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