开发者

Is it possible for us to download a file to a sandboxed location using File API available in HTML 5?

I wanted to ensure the documents I let user download are programmat开发者_C百科ically manipulated throughout program.

I came to know that File API does give Apps the opportunity to manipulate them. But how can we store the Files in the sandboxed location?


You cannot directly read or write anything to the file system. You always have to go through either the usual upload/save dialog, or rely on desktop drag-and-drop (you can drag files into most modern browsers, and out of Google Chrome, at least).


It seems you can't let the browser download the file directly into File API's sandbox now. You have to fetch the file by yourself in JavaScript and write it to a file through File API. If the file is from the same origin, you can just fetch it by XHR.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜