Volledige versie bekijken : link naar een bestand: "save as" ipv openen in browser
five-oaks
%Europe/Berlin %483 %2005, 12:36
Hoe krijg ik flash zover dat het een link naar een bestand niet direct opent in de browser maar vraagt om het op te slaan alvorens te openen?
on(release){ getURL(?);
}
groeten,
five-oaks
Laiverd
%Europe/Berlin %491 %2005, 12:47
Dat zul je met PHP (of ander serverside script moeten doen): check http://www.hotscripts.com/PHP/Scripts_and_Programs/File_Manipulation/Download_Systems/
Even als aanvulling en met dank aan Urami:
that's extremely simple , just make a small php and you can download any file
instead of opening in browser or default application :
In any text editor (notePad) paste the following :
<?
Header( "Content-type: image/jpeg");
header("Content-Disposition: attachment; filename=\"".$HTTP_GET_VARS["f"] . ".jpg"."\"");
include($HTTP_GET_VARS["f"] . ".jpg");
?>
call it 'download.php'
than go to it like download.php?f=filename it will add .jpg itself, for security reasons.
You don't need to hardcode the extension like I did, but it's better for security.
You don't want a hacker to go download.php?f=.htpasswd and get your password file :)
easiest way is to make a different php for each type you want... movdownload.php / gifdownload.php
if you want to change to other image just modify image/jpeg -> image/gif
IT works cross OS as long as the file and the script lay on same server with PHP support.
pretty much it
just in case here is an action sample , you want to download image1.jpg , button action will be :
on (release) {
getURL("download.php?f=image1");
}
now , you need to rememebr that the content type changes based on the file extension :
Header( "Content-type: image/jpeg");
Header( "Content-type: image/gif");
Content-type: application/pdf
Content-Type: audio/x-wav
Content-type: audio/x-mp3
or
Content-Type: audio/mpeg
and
Content-Typ: video/quicktime
Regards
urami_*
John
five-oaks
%Europe/Berlin %495 %2005, 12:54
Alvast bedankt voor de verwijzing.
Of het gaat lukken is een andere vraag.
PHP is grotendeels chinees voor me.
five-oaks
Roenes
%Europe/Berlin %586 %2005, 15:04
Zippen van je bestand doet ook genoeg ;) Dan vraagt flash uit zichzelf of je het wil downloaden of openen. :)
vBulletin® v3.8.1, Copyright ©2000-2012, Jelsoft Enterprises Ltd.