A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: fileReverence + Download

  1. #1
    Junior Member
    Join Date
    Feb 2001
    Posts
    4

    Question fileReverence + Download

    Hy everybody

    I have a problem with fileReverence.
    If i test the script in Flash8 everithing works fine.
    The file comes on my harddrive.
    But if i test the script on the Webserver the file doesnt come on my HD.
    The OS Window opens and after clicking "save" no file will be transvered.
    Where is the Problem?
    Everything is on the same Webserver (Security).

    Please help me
    Thanks

    Code:
    function downloadSheet() {
    	import flash.net.FileReference;
    	var listener:Object = new Object();
    	var fileRef:FileReference = new FileReference();
    	fileRef.addListener(listener);
    	var url:String = "productsheets/"+details2+"_spec.pdf";
    	if (!fileRef.download(url, +details2+"_spec.pdf")) {
    		trace("dialog box failed to open.");
    	}
    }
    Last edited by lion22; 02-12-2006 at 03:53 PM.

  2. #2
    Flash Gordon McUsher's Avatar
    Join Date
    Mar 2001
    Location
    Krautland
    Posts
    1,560
    Add the errors to the listener to find out, what is happening:
    Code:
    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.onHTTPError = function(file:FileReference):Void {
        trace("onHTTPError: " + file.name);
    }
    
    listener.onIOError = function(file:FileReference):Void {
        trace("onIOError: " + file.name);
    }
    
    listener.onSecurityError = function(file:FileReference, errorString:String):Void {
        trace("onSecurityError: " + file.name + " errorString: " + errorString);
    }
    You just need to change the trace command to get those messages into a textbox
    My letters on the F1 key have faded, how are yours today?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center