How to download file in computer silently using PHP? [closed]

感情迁移 提交于 2019-12-02 15:14:07

You can't.

It simply isn't possible, due to security issues.

Now, if these are systems on your own private network, and drives are shared and what not, you could write code to write out the files from the server. But, that is all outside of the user's browser. Other methods have included external applications running on the user's computer. When they click a link, the file to be downloaded is added to a queue in a database. The client application gets this data and will download it. AudioGalaxy used to use this method.

It's actually quite simple. Make them download an executable. They then need to execute it, and that executable than can take care to install a plugin into their browser that is able to write to disk and all that fun.

First of all, PHP is not client side language so something like this is not possible to do it in.

Next, as you can see in comments on your question, due to security reasons such actions are not allowed by browsers.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!