Oooooh, this is a bad issue… Been there many times helping others.
First, FTP is File-Transfer-Protocol. This means it is used for transferring files to SERVERS. Not for downloading to a client. (CLIENT-SIDE means BROWSER)
So, you have to use a standard download system or use a plug-in that handles it inside the BROWSER.
To download in a normal manner, you just link to the file. You can hide the link in a PHP page and call it, but, you can not FTP to a browser. (For instance, my laptop does NOT have an FTP server running on it, so I can not use any form of FTP to download to it.)
Here is a link that says you can send the file thru PHP. I have not tested it. Note that the file name would have to be a full path such as “\data\movie\other-folder-names\movie1.avi” or whatever… might work:
http://psoug.org/snippet/PHP-Download-File-To-Client_53.htm
On this site they show how to do it in PHP by creating an OBJ and flushing it to the browser which will then download the file. Look at response #2 on the page:
http://www.webdeveloper.com/forum/showthread.php?111312-Client-side-download-of-server-file
And, here is a tutorial type post that is very nice and easy to understand. Basically, the same as above, note the location is the full address on your site relative to where the PHP file is. If you do not understand that, I can explain further. Also, remember, if your PHP code is running on your server, it does not need to use FTP as it is already on the server. It just has to “push” the file to the browser. It is similar to a user clicking on a direct link to the file and the file downloads. (Just forces it to start behind the scenes. Since it is in PHP, no client can see your code, so you can use the PHP code to load the real file name from the DB using the movie’s ID and the location of the movie can be there too. (If you are downloading other files, replace the word movies… LOL) Hope this all helps! :
http://webdesign.about.com/od/php/ht/force_download.htm
(Note, you only need to add this code to you tracking code at the end of it. This “pushes” the header and file info to the browser and forces a download.)
Hope that all makes sense…