I have a flash doc that I will publish as an executable file, I want for the recipients of the CD to be able to download a pdf file (specifically pdf, I don't want to convert it to swf or whatever)without having to go on the internet. I want the file to be on the CD. What kind of script do I need to put in the button for the file? Also where do I need to put the pdf file? Thank you in advance for your time and help.
Zipping the files works well and has the advantage of cutting down the size of the download, however if you have access to a server side scripting language (eg PHP) you can also use that to handle the download of a file (and make sure you get a save dialog, instead of the browser opening the file directly). When the server sends a file to the browser it is sent with a file type the browser uses this to determine what it should do with it, eg if the file type tells the browser it is opening a pdf file it can call up acrobat reader to open the file directly.
PHP can be used to modify the http headers so the file is sent with the content type application/octet-stream (a sort of general purpose type) instead of its normal file type. because the browser doesn't know what to do with a file of this type it simply prompts for the user to save it, to do this you can create a php script like this,
// retrieve the filename to download from the query string of the page
$file = $_GET['filename'];
// send the headers
header("Content-disposition: attachment; filename=$file");
// and output the contents of the file
now to download a file you could call the PHP script with getURL,
If you zip the file, it is just a getURL call to that file. All zipped files will prompt a download. The PHP method requires a call to a PHP script on a server that supports PHP. You can then use the getURL method to essentially "trick" the browser into a download of the file instead of opening it in it's default application.
ok I read the whole thread and some of this stuff is a bit over my head. I downloaded Northcodes proxy and I can't figure it out, the exe doesn't open and I don't understand how to turn my pdf into a BAT file.