Creato da anpaz il 26/01/2009
Giuliano

Area personale

 

Tag

 

Archivio messaggi

 
 << Luglio 2024 >> 
 
LuMaMeGiVeSaDo
 
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31        
 
 

Cerca in questo Blog

  Trova
 

FACEBOOK

 
 

Ultime visite al Blog

red67aganpazcanzonipersempreandreadialbineafiltr
 

Chi puņ scrivere sul blog

Solo l'autore puņ pubblicare messaggi in questo Blog e tutti gli utenti registrati possono pubblicare commenti.
 
RSS (Really simple syndication) Feed Atom
 
 

 

Download forzato di files

Post n°1 pubblicato il 26 Gennaio 2009 da anpaz
 

27-Dec-2000 08:17
In response to webmaster@digitalshrine.com's post, it does work with netscape. I just finished a download script and it gives lets me save it as a filename (I am using Netscape v4.75). You can verify this and download something from http://www.vrillusions.com/downloads.shtml. Here is what my basic setup looks like:

$file_ext = substr($file_filename, -4);
if($file_ext == ".txt") { $content_type = "text/plain"; }
else { $content_type = "application/octet-stream"; }

$full_file_path = $file_path."/".$file_filename;
header("Content-Type: $content_type");
header("Content-Disposition: atachment; filename=$file_filename");
header("Content-Length: ".filesize($full_file_path));
readfile($full_file_path);
exit();

now $file_filename is what I get when I access the datafile and is something like textfile.txt or application.exe or archive.zip etc. and the $file_path is the absolute directory (ie, /usr/home/files) so I can actually place the files from outside the webdirecotry, making it almoast imposible to leech. Just make sure any files that need to be viewed in ASCII (php, html, perl, txt, etc) have a content type of text/plain or it won't download right.

 
Condividi e segnala Condividi e segnala - permalink - Segnala abuso
 
 
La URL per il Trackback di questo messaggio è:
https://blog.libero.it/dero/trackback.php?msg=6385909

I blog che hanno inviato un Trackback a questo messaggio:
 
Nessun Trackback
 
Commenti al Post:
Nessun Commento
 
 
 

© Italiaonline S.p.A. 2024Direzione e coordinamento di Libero Acquisition S.á r.l.P. IVA 03970540963