specifying a subfolder where download files with the API chrome.downloads
for a chrome extension
I am trying to implement the option filename of the Chromes.downloads API
(http://developer.chrome.com/extensions/downloads.html#method-download) to
set a relative path to set the destination of the downloads of my
extension. This is the code:
var destPath = \manuals\document.pdf
chrome.downloads.download({filename: destPath, url:
www.website.com/document.pdf, saveAs: false});
It is supposed to download that file in a folder called manuals inside my
chrome downloads default browser. But it gives me the next error:
downloads.download: Invalid filename at downloadFiles
(chrome-extension://jfemmmdckolfflaccjfajeabkfikljmm/extensionFunctions.js:43:20)
at XMLHttpRequest.xhr.onload
(chrome-extension://jfemmmdckolfflaccjfajeabkfikljmm/retrieveFilesURLs.js:49:5)
Any hint? Cant find why it is not working
No comments:
Post a Comment