如何从Javascript打开具有指定路径的html文件对话框? [英] How to open html file dialog with specified path from Javascript?

查看:886
本文介绍了如何从Javascript打开具有指定路径的html文件对话框?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经输入了type="file",在单击按钮时,文件弹出窗口已经使用默认文件夹打开了.就像C:/USERS/XYZ/Downloads

I've input with type="file", on clicking on button the file popup has been opening it with default folder. like C:/USERS/XYZ/Downloads

但是我的要求是,我想打开具有指定路径的文件弹出窗口(无论我将提到D:/Images/Stuff之类的路径).我在Google上搜索了很多&对此没有任何运气.

But my requirement is, I want to open file popup with specified path(whatever I'll mentioned path like D:/Images/Stuff). I googled a lot & don't having any luck on this.

是否可以通过指定的文件夹/路径打开文件弹出窗口?

Is there any way to open file popup with specified folder/path?

JsFiddle

任何帮助/指针都将感谢,谢谢

Any help/pointers would appreciate, Thanks

推荐答案

您无法设置该值.因为html不是特定于设备的.这意味着可以在任何计算机的任何浏览器上看到它.请阅读此设置输入文件格式的默认值

You cannot set the value. Because the html is not device specific. Meaning it can be seen on any browser of any machine. Please read this Set default value for a input file form

这篇关于如何从Javascript打开具有指定路径的html文件对话框?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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