在不打开对话框的情况下读取本地文件(在浏览器中)

编程入门 行业动态 更新时间:2024-10-07 06:38:50
本文介绍了在不打开对话框的情况下读取本地文件(在浏览器中)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

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

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.

更多推荐

在不打开对话框的情况下读取本地文件(在浏览器中)

本文发布于:2023-11-12 21:16:18,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1582546.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:对话框   情况下   器中   本地文件

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!