0

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 ;-) Commented 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. Commented Jul 6, 2013 at 1:41

3 Answers 3

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.

Sign up to request clarification or add additional context in comments.

2 Comments

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?
@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.
1

Fortunately, there isn't a way - security reasons.

Comments

0

by using macros like macro scheduler one can automate the process.

1 Comment

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.