[英]CURL in php returns a display text in my page
嗨,我有這個 curl 可以從 sendthisfile.com 下載鏈接文件。 現在我的問題是當我上周嘗試測試它時,我的代碼運行良好。 但是現在當我測試它時,這就是我的網絡應用程序。 我懷疑這是來自處理文件時的 curl。 有人可以幫我解決這個問題嗎? 這是我下面的 curl 代碼
$zipUrl = "https://download.com/sample.zip";
$fileName = date().".zip"; //create a random name or certain kind of name here
$fh = fopen($filename, 'w');
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $zipUrl);
curl_setopt($ch, CURLOPT_FILE, $fh);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); // this will follow redirects
curl_exec($ch);
curl_close($ch);
有人可以幫助我為什么這會在網頁中拋出文本嗎?
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.