php force download 其他DOMAIN 既FILE..

我有個FILE 放係 http://www.abc.com/a.zip
我想http://www.eee.com/download.php?file=a.zip

dl到 上面條LINK既FILE.. 但係要HIDE左條LINK..
即係唔想用 header ('location: http://www.abc.com/a.zip')
我想做到? THX

本身download.php  有得FORCE DL FILE, 但因為 a.zip 依家MOVE左去cloud..
所以本身 header('Content-Disposition: attachment; filename="' . $file_name . $file_name_extension . '" '); 唔WORK..

THX 各位..

我有個FILE 放係
我想

dl到 上面條LINK既FILE.. 但係要HIDE左條LINK..
即係唔想用 header ('location:  ...
Poissons 發表於 2012-5-24 18:48


我告訴你這是沒有用的一樣見到你個下載位置.真想隱藏下載位置要在HTTPD上做

TOP

我告訴你這是沒有用的一樣見到你個下載位置.真想隱藏下載位置要在HTTPD上做 ...
sonichkhk 發表於 2012-5-24 18:59

其實我係放左d file 係 cloud front 度..
但d file 要 member login左先可以dl.. 所以唔可以比direct link比人dl...

如果個file 放係自己server度就易搞..

TOP

本帖最後由 domeso 於 2012-5-24 20:18 編輯

fopen in binary and echo the data, which honest, does not make much sense with large files.

I would sometimes do this approach:
http://192.168.0.1/foo.php?download_file=bar.zip

the file is at some where not web root, but somewhere in the filesystem (or at least with a DIR with a .htaccess .htpasswd control if needs to be within web root)

in foo.php I ln the /some_path/bar.zip to web root /pool/some_random_hash/bar.zip
then header("location: http://192.168.0.1/pool/some_random_hash/bar.zip");
and I clean these hard link in /pool/ by creation date time example every 8 hour or so by cronjob.

TOP

fopen in binary and echo the data, which honest, does not make much sense with large files.

I would ...
domeso 發表於 2012-5-24 20:17

但我 想dl果d file 好大..幾百mb 一個~
今日amazon 個人,話佢地既cloudfront 做到我想要既野..

唔知洗唔洗用佢套api搞..

TOP

回復 5# Poissons


Yeah as I mention that does not make sense if file are large...

Not familiar to cloudfront so do not know much, but normally for these cloud service, if they provide a "normal" and "modern" apis, usually are just piece of cake..

TOP

本帖最後由 sonichkhk 於 2012-5-24 23:57 編輯
但我 想dl果d file 好大..幾百mb 一個~
今日amazon 個人,話佢地既cloudfront 做到我想要既野..

唔知洗唔 ...
Poissons 發表於 2012-5-24 20:31


你用s3的話 為什麼不用amazon提供的Bucket Policies,可擋不少盜連了

TOP

回復  Poissons


Yeah as I mention that does not make sense if file are large...

Not familiar to c ...
domeso 發表於 2012-5-24 23:39



   
你用s3的話 為什麼不用amazon提供的Bucket Policies,可擋不少盜連了
sonichkhk 發表於 2012-5-24 23:55


佢d sdk 同api 要安裝好多野.. 同好多doc.. 我未details 咁睇.. 我估都做到~
但想未learn 佢d野前,睇下有無方法搞到..如果無就 要用佢套sdk...

thx 各位~

TOP