问题
I am using chrome.experimental.downloads.download() to download url, but I cannnot set downloads location. All the url downloaded to default location of chrome.
I have tired {url: xxxxxxxxxx, filename"\file\pic.jpg"}, but that didn't work.I don't known how to use chrome.experimental.downloads.setDestination() which might work.
Any hints?
Thanks~
回答1:
You currently cannot set the destination, it's not a function that is available in the API. The only mention I can find of setDestination
is in an old Chromium ticket on this extension, but it seems that this functionality either never made it in to the current builds or is still being worked on.
The only thing you can do for now is set saveAs
to true in the options object and let the user choose where to save it.
Update: I just checked the Chrome source code and in the current trunk version setDestination
is marked as NOTIMPLEMENTED
, so no joy on that one.
来源:https://stackoverflow.com/questions/11653361/how-to-set-download-location-via-chrome-api