文件浏览器默认目录 [英] file browser default directory

查看:81
本文介绍了文件浏览器默认目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用type ="fie"的输入元素来创建文件浏览器.
我需要知道是否有一种方法可以设置默认目录,以便当我按浏览"时,此确切的目录将打开(比如说c:\ windows \)

预先感谢,
Yaniv

I used the input element with the type="fie" to create a file browser.
I need to know if there is a possible way to set a default directory,so that when i press ''browse'' this exact directory will open (let say c:\windows\)

Thanks in advance,
Yaniv

推荐答案

我猜这是不可能的.

原因是,文件上载控件在客户端的浏览器中运行.客户端的磁盘组织和文件夹层次结构可能有所不同,客户端可能具有不同的操作系统(可能没有驱动器概念).因此,即使从服务器代码(或使用客户端脚本)为文件上传控件设置了默认文件夹,对于大多数客户端来说,该文件夹也会失败.

因此,不幸的是,您似乎无法做到这一点.

但是,文件浏览器窗口可能能够记住上一个文件选择的文件夹位置.不确定这对您是否方便.
I guess this is not possible.

The reason is, the File upload control runs in client''s Browser. A client could have differences in their disk organization and folder hierarchy, they could have different OS (Which might not have the drive concept). So, even if a default folder is set for the file upload control from the server''s code (Or, using the client side scripting), it would have failed for most of the clients.

So, unfortunately, it seems you can''t do that.

However, the file browser window might be able to remember the folder location of the previous file selection. Not sure whether this is handy for you or not.


这篇关于文件浏览器默认目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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