Click to See Complete Forum and Search --> : Download button
ant_Z
04-16-2007, 05:00 PM
Hello again
One question. In KE if i click file link i got open 'save' window without any prompt.
How to do something similiar? Im sure it was asked somewhere but i cant find that :|
rgrds
dniezby
04-16-2007, 10:39 PM
It's a setting in your user's browser.
You'll notice that KE uses zip files. Most browsers default to save these files instead of downloading or opening.
It's nothing on your side. It's an end user issue.
But I'm curious as to what you mean about being prompted?
ant_Z
04-17-2007, 11:29 AM
I want to have http://img142.imageshack.us/img142/4726/popupcm3.jpg instead of 'Save'...
this is not browser setting - any link to file opens that window. but some links opens 'Save' window - and this is not extension specyfic, it belongs to site's code.
for example, in my WebMail every attachment have got 2 options: Open and Save.
Open opens it in new window and save opens the "Save" dialog.
and this is default browser setting - its the same situation on FF and IE (I use Opera).
so there must be specified code for this, i think its messing with target parameter but... i dont know.
blanius
04-17-2007, 10:39 PM
It is a browser thing. Using simple links it cannot be done. You can use the filereference commands to open a download dialog.
Here's the AS2 example from Adobe LiveDocs
import flash.net.FileReference;
var listener:Object = new Object();
listener.onSelect = function(file:FileReference):Void {
trace("onSelect: " + file.name);
}
listener.onCancel = function(file:FileReference):Void {
trace("onCancel");
}
listener.onOpen = function(file:FileReference):Void {
trace("onOpen: " + file.name);
}
listener.onProgress = function(file:FileReference, bytesLoaded:Number, bytesTotal:Number):Void {
trace("onProgress with bytesLoaded: " + bytesLoaded + " bytesTotal: " + bytesTotal);
}
listener.onComplete = function(file:FileReference):Void {
trace("onComplete: " + file.name);
}
listener.onIOError = function(file:FileReference):Void {
trace("onIOError: " + file.name);
}
var fileRef:FileReference = new FileReference();
fileRef.addListener(listener);
var url:String = "http://www.macromedia.com/platform/whitepapers/platform_overview.pdf";
if(!fileRef.download(url, "FlashPlatform.pdf")) {
trace("dialog box failed to open.");
}
flashkit.com
Copyright WebMediaBrands Inc., All Rights Reserved.