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,
code:
<?php
// download.php
// retrieve the filename to download from the query string of the page
$file = $_GET['filename'];
// send the headers
header("Content-type: application/octet-stream");
header("Content-disposition: attachment; filename=$file");
// and output the contents of the file
readfile($file);
?>
now to download a file you could call the PHP script with getURL,
I find your post really confusing.
I believe you have a flash projector running of a CD, but I haven't understood where the .pdf file is.
On the same CD? On the web?
If the .pdf file is in the cd, I don't know how you can download it... I guess you download something that's on the internet... But this post (Northcode's proxy) lets you open a .pdf from the cd.
This may open or download the file, depeding on the user-se preferences. I guess you may force a download with a server side scripting language like PHP.
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 so on the cd I will have the exe file, the autoexecute file, and a few pdfs, not in any folders. So what would the "url" be to find the file on the CD?
The methods I posted are for an online environment. If your .exe is developed for offline, check out the link in nunomira's post about the northcode option of opening a .pdf file from an exe.
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.