开发者

File Download using HTML 5 , Javascript and File API

开发者 https://www.devze.com 2023-04-07 06:49 出处:网络
Can we integrate the FileAccess API of HTML with normal download of Files using javascript. We typically download a file by the below way:

Can we integrate the FileAccess API of HTML with normal download of Files using javascript.

We typically download a file by the below way:

var fileUrl='../File.doc';    
window.open(fileUrl,'Downloading');  

Now I believe that the file would be downloaded to tempFolder and the folder designated by us for download.

But is it possible for us to download the file to a sandboxed location as mentioned in WWC draft on HTML 5 File API.

If this is possible, I believe "need for a way to delete downloaded files" of my previous quest开发者_开发百科ion would be solved.


There's a new download attribute you can add to links that tells the browser to download the resource rather than navigating to it. That downloads the file to whatever "Downloads" folder the browser uses by default. You cannot programmatically delete files that are downloaded. That would be a security risk.

0

精彩评论

暂无评论...
验证码 换一张
取 消