Hi all, first of all, sorry for the terrible english.

I am building up an entire website and i need help for the download section, the problem is that i don't want to use the format [url]ftp://user:pass@host/file.zip[/url] since IE no longer supports it, and also because i only have 1 account on this ftp website and it has full read/write/delete permissions.

How can i create something that would connect to the ftp server, and then ftp_get the file DIRECTLY to the visitor thats requesting it? Every attempt i have done all resulted the same, i was using simple PHP FTP functions such as ftp_get()... but the problem with those is that the file is download ON THE WEBSERVER, not on the visitor that clicked the link...

What i need is a kind of "connector" or "bridge" between the private ftp server and the guys that wants to download the file. Anyone know how do i do that, anyone know a simplier way to do that? Please i really need help and i started writing php code 1 month ago, so im sure you guys can guide me!! thanks in advance.

Bests regards

fmp

    $file = 'ftp://user:pass@host/file.zip';
    header('Content-Description: File Transfer');
    header('Content-Type: application/force-download');
    header('Content-Disposition: attachment; filename=' . basename($file));
    readfile($file);
    

    This is what i was doing...but this is WRONG...since my webserver reads the file and my webserver uploads the file! i want to use the private ftp servers bandwidth since its a way faster...

    thanks

    fmp

      Would it not work if you just used HTTP for the download? If a MIME type is not recognized by the browser (such as .zip in your sample code), the user would be prompted for a download. Are you not able/permitted to do this?

        Write a Reply...