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?
Asked
Active
Viewed 888 times
0
-
This depends on the browser - it's a *user client preference* in some cases (i.e. ["Always download files to.."](http://support.mozilla.org/en-US/kb/change-firefox-behavior-when-open-file)). 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 Jul 06 '13 at 00: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 Jul 06 '13 at 01:41
3 Answers
2
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.
-
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? – Alexander Nazarkin Jul 06 '13 at 00:51
-
@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. – jcsanyi Jul 06 '13 at 00:53
0
by using macros like macro scheduler one can automate the process.
-
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](/help/how-to-answer). – Community Apr 14 '22 at 20:58