I have a requirement in my current project. I have to generate a dynamic file in server and save that file in to client machine without showing him for download. I have the code for force downloading in php. Where I can gave option to client to save a file from server to its computer. But here I want to do something like cookie works. Save file in client automatically without option to user to download it. If cookie can do the same thing there should be some way to do it. Anybody have any idea how it can be work.
Asked
Active
Viewed 2,000 times
3
-
2Not a good idea. If there was a way to easily force a silent download, it'd be MASSIVELY exploited by malware pushers. You'd be better off telling your clients to set browser defaults when the first download occurs. – Marc B Jun 26 '13 at 15:20
-
Can you clarify how this file will be used? Do you want to be able to save a file into a user's home folder or desktop without prompting, or do you just need to store persistent data larger than a cookie on the client PC? – Justin ᚅᚔᚈᚄᚒᚔ Jun 26 '13 at 17:56
1 Answers
5
If cookie can do the same thing there should be some way to do it.
False. Completely false, I can't stress how false this is.
You cannot save the file on someone's computer without them knowing it. Period. Anyone who gave you that task is an idiot, sorry for my choice of words, the notion of you storing something on my pc without me being notified would mean immediately that tons of websites out there would fill my computer with god knows what and I would never use internet again.

N.B.
- 13,688
- 3
- 45
- 55
-
You are right in some aspect. If I can store any files automatically to client machine without notify him, I will kind of malicious job. But scenario is here client don’t want to save any download file rather want it store somewhere automatically. I know you are right, even I convey the same to client. I will give you +1 for this but not make it right until my client satisfy with your answer :) . – Amar Banerjee Jun 26 '13 at 15:27
-
1Set browser defaults.. Tell them to do that.. Then its optional auto download – Daryl Gill Jun 26 '13 at 15:29
-
What you can do is create the file and the offer the user a LINK to download it. That's as far as you can go. It's a limitation of technology that we use, and that limitation exists for a reason. You need to convince your client that you are the expert in the field, and that they can't just think of a feature and make you do it. It's standard practice that you always generate a link and let people download files if they want to. – N.B. Jun 26 '13 at 15:29