Re: how to hide the url of a file for download
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.php archive

Re: how to hide the url of a file for download

From: Alvaro G Vicario <alvaro_QUITAR_REMOVE@telecomputeronline.com>
Date: Fri Jul 01 2005 - 10:23:08 CEST

*** _andrea.l wrote/escribió (Fri, 01 Jul 2005 07:59:43 GMT):
> I'd like to let user download a file but I'd like to hide the url of the
> file.

Downloading a file from a hidden URL is like calling someone whose phone
number is unknown...

> ... how can I write download_file.php?

Given that what you really want to know is how to write a download script,
I've found this example in the manual page for header():

<?php
// We'll be outputting a PDF
header('Content-type: application/pdf');

// It will be called downloaded.pdf
header('Content-Disposition: attachment; filename="downloaded.pdf"');

// The PDF source is in original.pdf
readfile('original.pdf');
?>

It shouldn't be difficult to write a generalization.

-- 
-- Álvaro G. Vicario - Burgos, Spain
-- http://bits.demogracia.com - Mi sitio sobre programación web
-- Don't e-mail me your questions, post them to the group
--
Received on Mon Oct 17 21:00:20 2005