我的问题正在引起我的cra。
我正试图通过一个参数从一个遥远的服务器下载一个文件,该参数是从外部来源寄给我,并将它节省到我的服务器上的一个特定目录。
该守则是:
// value of this variable is something like http://api.com/20110720-202122_dceb89c3-a468-4de8-a37f-4f594bc5aab8.mp3
$recordingURL = $_REQUEST[ RecordingURL ];
$filename = basename($recordingURL);
$path = ../mp3/TT/ .$filename;
if(!file_exists($path))
{
if (!mkdir($path, 0755 , true))
{
errorLog( handlemp3.php , 0 , could not make recording directory );
}
}
$fp = fopen($path, w );
$ch = curl_init($recordingURL);
curl_setopt($ch, CURLOPT_FILE, $fp);
$data = curl_exec($ch);
curl_close($ch);
fclose($fp);
At first I was seeing that the "TT" directory was not being created and I realized that the problem was that I did not set the recursive property in the mkdir to true. Once I did that, I saw the TT directory created on the server. The weird thing is that now I am not seeing the MP# created on the server.
没有人会想为什么? 我没有“美元=错误_get_last()”,并且看到,我正在经历一个错误,如“Directive Register_long_arrays在PHP5.3和更大的范围内被折旧”,但我没有想法可以推翻这一错误。
谁能在这里帮助?
感谢!