Quote:
Originally posted by Lord Humungus
now...how can we do that same thing with a jpeg or gif rather than an mp3 file?
EDIT: can you explain what if (!readfile($fol."\\".$file)) does? Im trying to do the same thin with Cold Fusion and rather than an mp3...do it with a jpg. Thanks!
|
It reads the file in the directory $fol with filename $file and writes it to standard output, i.e. the client requesting the page. But it's PHP and I don't know anything about ColdFusion so I can't help you with that part. However if you were using PHP you'd do it exactly the same way with a JPEG, just with a different filename.
By the way, that script is a bit of a security risk; all you have to do is change the values of fol and file and you can download any file for which the httpd process has read permission. Also, having register_globals on (where PHP maps the values for fol and file to $fol and $file) is a security risk in general, though probably not with this script, because a user who knows the names of variables in your script can add keys and values to the HTTP request and change the initial values of those variables. Just letting you know.