如何使用PHP下载doc文件?

时间:2011-06-02 19:04:27

标签: php file calendar downloading

我知道有些PHP功能允许用户下载或者你使用PHP下载文件但是我还没有看到一个允许你的php文件导航和下载文件并将其存储在特定目录中的文件。

所以这就是我想要做的。我有一个运行php应用程序的Web主机。然后我有一个带日历的网站。日历上有选项......

工具--->导出为doc

我想写一个PHP代码,EVERYDAY自动转到日历的工具选项,然后将名为Team Calendar的日历下载到脚本可以使用它的webhost中。 出于实验目的,我们假设日历网址位于http://webdesign.about.com/od/php/ht 我该怎么做?

非常感谢

编辑:我试过这就是我的意思,我怎样才能从工具中下载文件中的文件?

[/cygdrive/c/documents and settings/omar.khawaja]$ wget http://confluence.com/display/prodsupport/Team+Calendar
--2011-06-02 16:33:43--  http://confluence.rogersdigitalmedia.com/display/prodsupport/Team+Calendar
Resolving confluence.com... 204.225.248.160
Connecting to confluence.com|204.225.248.160|:80... connected.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: http://confluence.com/login.action;jsessionid=2F13926CF763FE4F3862FAFC24AB81D7?os_destinati
on=%2Fdisplay%2Fprodsupport%2FTeam%2BCalendar [following]
--2011-06-02 16:33:43--  http://confluence.com/login.action;jsessionid=2F13926CF763FE4F3862FAFC24AB81
D7?os_destination=%2Fdisplay%2Fprodsupport%2FTeam%2BCalendar
Connecting to confluence.com|204.225.248.160|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 7865 (7.7K) [text/html]
Saving to: `login.action;jsessionid=2F13926CF763FE4F3862FAFC24AB81D7@os_destination=%2Fdisplay%2Fprodsupport%2FTeam+Cale
ndar'

100%[==============================================================================>] 7,865       --.-K/s   in 0.04s

2011-06-02 16:33:43 (207 KB/s) - `login.action;jsessionid=2F13926CF763FE4F3862FAFC24AB81D7@os_destination=%2Fdisplay%2Fp
rodsupport%2FTeam+Calendar' saved [7865/7865]

enter image description here

1 个答案:

答案 0 :(得分:-1)

您需要在服务器上使用cron作业来执行此操作。让cron作业调用一个PHP脚本,只需将doc保存到Web服务器上的目录中。