一键下载并保存(使用php)

问题描述:

如何从php页面下载文件,然后将其保存到文件夹中,然后检索保存的文件,然后将其发送给数据库内的所有用户.

How to download a file from a php page then save it into a folder, after that retrieve the saved file then send it to all user inside the database.

从客户端的角度(下载始终由扮演客户端角色的软件完成),没有诸如"PHP页面"之类的东西.对于客户端,所有页面都是相同的. HTTP是HTTP.

如果您想使用PHP下载任何内容,请参见: http://php.net/manual/zh/function. fopen.php [ ^ ].此页面上有一个下载示例,请找到它.基本上,您只是打开一个流并通过其URL绑定任何资源,这取决于您使用的URL方案.这对于下载代码是透明的.

—SA
From the standpoint of the client (download is always done by software playing the role of the client), there is no such thing as "PHP page". For a client, all pages are the same. HTTP is HTTP.

If you want do download anything with PHP, look here: http://php.net/manual/en/function.fopen.php[^]. There is a download sample on this page, please find it. Basically you simply open a stream and binds with any resource by its URL, depending on the URL scheme you use. This is transparent to the downloading code.

—SA