Question
No progresss information when downloading
I have a small mp3 player on our band website that have the
option for people to download our mixes. Everything work perfect
except for one thing. The download is working and the files get
downloaded but there's no progress information (progress bar) while
the download goes on. The files are 75MB so they do not exceed the
100MB issue. What's going wrong?
Here's the script:
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);
// save button action
saveBut.onPress = function() {
var local:String = file.substr(file.lastIndexOf("/")+1);
fileRef.download(file, local);
trace(local);
};
Here's the script:
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);
// save button action
saveBut.onPress = function() {
var local:String = file.substr(file.lastIndexOf("/")+1);
fileRef.download(file, local);
trace(local);
};