php: farklı etki kuvvetleri indir?

0 Cevap php

hey guys, i wonder if you guys come up with some awesome solutions for my problem. the normal way is not working!

Eh, ben zorla indirmek için aşağıdaki php komut ile herhangi bir web sitesine herhangi bir dosyayı çalışıyorum. Ben sadece geçmektedir? P = http://www.whatever.com/images/flowers/rose.jpg benim url ve indirme istemleri.

    <?php
    error_reporting(E_ALL);

    if(isset($_GET['p'])) $path = $_GET['p'];
    else echo "no path set!";

    $file = $path;
    //header('Location:' . $file); //works perfect, opens the file in the browser
    //
    header("Cache-Control: no-cache");
    header("Expires: -1");
    header("Content-Type: application/octet-stream;");
    header("Content-Disposition: attachment; filename=\"" . basename($file) . "\";");
    header("Content-Transfer-Encoding: binary");
    header("Content-Length: " . filesize($file));
    echo readfile($file);
    ?> 

Ben bugün öğrendim Ancak, dosya boyutu () değil sadece bir http isteği ile benim sunucuda yerel dosyaları ile çalışır. Aynı Readfile için de geçerlidir ()

Warning: filesize() [function.filesize]: stat failed for pathtofiles…/downloader/d.php on line 15

Warning: readfile(sphotos.ak.fbcdn.net/hphotos-ak-snc4/hs211.snc4/…) [function.readfile]: failed to open stream: HTTP request failed! HTTP/1.0 403 Forbidden in pathtofiles…/downloader/d.php on line 16

bana burada yardımcı olabilir orada yaratıcı kodlama olup olmadığını merak ediyorum. Bana o komut çalışması yapmak için herhangi bir şans var mı? Ben sadece iletmekten ne dosyası ve url forcedownload istiyorum.

thank you advance, regards matt

0 Cevap