我有这个URL
www1.intranet.com/reportingtool.asp?settings=var&export = ok
在那里我可以下载报告.报告的文件名包含时间戳.例如123981098298.xls,每次下载都会有所不同.
我想要一个具有此功能的脚本:
<?php
//Download the File
//rename it to **report.xls**
//save it to a specified place
?>
Run Code Online (Sandbox Code Playgroud)
搜索stackoverflow和谷歌搜索这个主题后我没有任何想法:(
这通常是可能的吗?
您可以下载报告file_get_contents:
$report = file_get_contents('http://www1.intranet.com/reportingtool.asp?...');
Run Code Online (Sandbox Code Playgroud)
并在本地保存(在运行PHP的机器上)file_put_contents:
file_put_contents('/some/path/report.xls', $report);
Run Code Online (Sandbox Code Playgroud)
cURL该请求完成对请求的完全自定义.fopen/ fread/ fwrite).| 归档时间: |
|
| 查看次数: |
11261 次 |
| 最近记录: |