新聞中心
這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
php如何實現(xiàn)隱藏實際地址的文件下載-創(chuàng)新互聯(lián)
這篇文章主要介紹了php如何實現(xiàn)隱藏實際地址的文件下載,具有一定借鑒價值,感興趣的朋友可以參考下,希望大家閱讀完這篇文章之后大有收獲,下面讓小編帶著大家一起了解一下。
具體如下:
下面這段php代碼可不透露實際的文件下載地址。
function download_document($filename,$path="",$mimetype="application/octet-stream") { header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); header("Content-Disposition: attachment; filename = $filename"); header("Content-Length: " . filesize($pathto . $filename)); header("Content-Type: $mimetype"); echo file_get_contents($pathto . $filename); }
實現(xiàn)方法二:
感謝你能夠認(rèn)真閱讀完這篇文章,希望小編分享的“php如何實現(xiàn)隱藏實際地址的文件下載”這篇文章對大家有幫助,同時也希望大家多多支持創(chuàng)新互聯(lián)網(wǎng)站建設(shè)公司,,關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道,更多相關(guān)知識等著你來學(xué)習(xí)!
本文題目:php如何實現(xiàn)隱藏實際地址的文件下載-創(chuàng)新互聯(lián)
鏈接分享:http://fisionsoft.com.cn/article/decspi.html