admin管理员组文章数量:1356216
I want to download folder that client side (browser) make.
I considered using File API, but I can't find how to make folder.
For example, some png make from html canvas put one folder, I want to save this folder with download dialog.
I want to use a folder for some file to one folder.and I must download only once.
Please advise me.
html
<a download='folder' href='#' onclick="Download()">download</a>
I want to download folder that client side (browser) make.
I considered using File API, but I can't find how to make folder.
For example, some png make from html canvas put one folder, I want to save this folder with download dialog.
I want to use a folder for some file to one folder.and I must download only once.
Please advise me.
html
<a download='folder' href='#' onclick="Download()">download</a>
Share
Improve this question
edited Mar 11, 2014 at 21:04
hucuhy
asked Mar 11, 2014 at 20:30
hucuhyhucuhy
8293 gold badges10 silver badges15 bronze badges
4
- you just asked this a while ago and then deleted it, why didnt you just edit the question? You need to be more clear in what you are wanting. – Patrick Evans Commented Mar 11, 2014 at 20:34
- Sorry. I was freaked out. – hucuhy Commented Mar 11, 2014 at 20:42
- Where is the folder ing from? A server? FTP? MVC? your tags are all client side stuff. Need to know that. – Mike Commented Mar 11, 2014 at 20:58
- Nowhere.Browzer(not server) make the folder.I want to download this folder. – hucuhy Commented Mar 11, 2014 at 21:01
2 Answers
Reset to default 3You can use FSO.js, but be warned that it currently only works in Chrome. Additionally, the folders you create can only really be accessed from within your webapp (for example, you can't choose to write a specific folder on the C drive).
Firstly, You can't really interact with the local system or the server with JavaScript because of security. You can call a server-side script with JavaScript, via AJAX.
If you don't care, you can check out Javascript FSO CreateFolder Method
JavaScript Example...
// initialize ActiveXObject and create an object of Scripting.FileSystemObject.
var fso = new ActiveXObject("Scripting.FileSystemObject");
// creates a folder with specified name at the specified location
fso.CreateFolder("C:\\Temp\\myFolder");
fso = null;
本文标签: javascriptHow to Create a New Folder for Downloading a FileStack Overflow
版权声明:本文标题:javascript - How to Create a New Folder for Downloading a File - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1743995126a2572850.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论