I Have a Download Button or a link when your click on it, it shows a Save As Dialog box to save the file my question is, is there anyway to atomically click save on that button, so when the user clicks it, it saves to their hard Drive?
2
-
This depends on the browser - it's a user client preference in some cases (i.e. "Always download files to.."). That being said, there is no way to configure it from (normal) JavaScript or PHP. Again, user client preference, not the preference of your site ;-)user2246674– user22466742013-07-06 00:38:26 +00:00Commented Jul 6, 2013 at 0:38
-
you can click the save button, and that can sometimes allow un-attended downloading, but what happens next is not handled in a consistent or dependable manner. chrome saves automatically, firefox ask you the first time the file's mime is downloaded, with an option to "remember" the action.dandavis– dandavis2013-07-06 01:41:39 +00:00Commented Jul 6, 2013 at 1:41
Add a comment
|
3 Answers
Assuming you're talking about a page viewed in a web browser, no - there's no way to automatically click the "Save" button for the user.
Allowing a webpage to arbitrarily save files to the user's hard drive with no user interaction would be a huge security problem.
That being said, there are ways to encourage the browser to open/view the file directly instead of asking the user to save it, as well as options for a page to save some data locally in local storage.
2 Comments
Alexander Nazarkin
Would there be any way to only save the file into the downloads folder and not where the user wants to? without allowing the user to change the file name?
jcsanyi
@AlexanderNazarkin That's the part that user2246674 was talking about above, where he said it was a browser preference. There's no way to force that from a script.
by using macros like macro scheduler one can automate the process.
1 Comment
Community
Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.