Download (método FileReference.download)

Hello!
I am writing from Colombia, so I hope forgive me for my
English so basic and aid translator.
My question is this:
I need to use the method: download (FileReference.download
method)
to be updated a number of flv I have a computer but the
disadvantage is that the customer asked me that was so hidden
without participation of a user with keyboard or mouse, you can
perform this task?
Thanks

you can't force a download on a user without their active
participation (using some kind of interface device like a
keyboard/mouse/joystick/etc).

Similar Messages

  • Why doesn't AS3 FileReference Download Work in IE/FF (Works fine in Chrome)

    I am generating an Excel file with Java on the back-end and it seems to work just fine in Chrome but for whatever reason it doesn't in FF/IE. I have the very latest of Flash in each browser listed from this site: http://helpx.adobe.com/flash-player/kb/find-version-flash-player.html
    I'm sending XML to the server, it is generating the Excel and sending it to the Flash. I'm performing the export by doing the following:
    private var _fileRef:FileReference;
    private function exportReport(e:MouseEvent):void
        _fileRef = new FileReference();
        _fileRef.addEventListener(Event.COMPLETE, excelExportCompleteHandler);
        _fileRef.download(new URLRequest("exportReport"), "report.xlsx");
        function excelExportCompleteHandler(e:Event):void {
            trace('complete');
    There are no error messages from Java/Flash. The browse popup comes up and I save the file the same in IE/FF as I do in Chrome. the trace('complete') is executed every time in every browser but the file only shows up when using Chrome.
    I also searched my filesystem and found temporary internet file shortcuts with the name of the file I was trying to download so it's as if it started the download but didn't finish it for some reason. The location of those files is AppData\Roaming\Microsoft\Windows\Recent Items

    Definitely not a timeout, it takes < 5 seconds for the web service call to finish
    I can also copy and paste the request url with data into the browser and it will successfully download the report just through the browser which made me realize I could use javascript as a non-ideal workaround solution to this problem.
    I would still love to know why it was failing and if anyone has any ideas that would be great but for anyone else with the same issue as me here is the workaround I used:
    as3 code (I used URLVariables to encode the data because trying encodeURI or encodeURIComponent didn't encode ' or " which would cause errors when doing the ExternalInterface.call()
    var reportData:String = getReportXML().toString();
    var variables:URLVariables = new URLVariables();
    variables.q = reportData;
    //Substring at 2 to trim off the 'q=' portion
    reportData = variables.toString().substring(2);
    ExternalInterface.call("function() { return downloadExcelReport('"+reportData+"')}");
    javascript code (I used a hidden form because I needed to be able to perform a POST because the xml data I was passing was too large for a GET)
    <script type="text/javascript">
        function downloadExcelReport(reportData) {
            reportData = decodeURIComponent(reportData);
            window.open("about:blank", "newWindow");
            document.getElementById("reportData").value = reportData;
            document.getElementById("reportForm").submit();
    </script>
    <form id="reportForm" method="post" target="newWindow" action="<%=SERVER_PATH%>excelReport">
        <input type="hidden" name="solutionReportXml" id="reportData" value="">
    </form>

  • How do you download a static file using a FileReference and URLRequest and show the progress?

    All,
       I'm trying to download static content (PDFs) off of my server using tutorials from adobe's site and some online as well and i'm having no luck showing an updated progress bar.  I attached the meat of my code below.  If a user clicks a hyperlink, it calls the downloadPDF method passing in a constant url defined.
      When debugging, i can see that the event.bytesLoaded is incrementing on each call to the progress method, however the bytesTotal is only set to the intitial number of bytes transferred on the first pass through the method.  (Ex:  First time the method is called, bytesLoaded and bytesTotal will be 4,000... which i dont understand... the bytesTotal should be the total size of the file being downloaded.. definitely not the case...  the next time the method is called, bytesLoaded will increases to some number while bytesTotal will remain at 4,000).  This happens during the entire file transfer.
    Am i missing something? Are the examples incorrect?  Also to note, i'm using sdk 3.2 (Not sure if that makes a difference.)
    Thanks for any response or insight.
    Damian
    <mx:Script>
            <![CDATA[
                import com.ctc.fema.resources.Buttons;
                import flash.net.FileReference;
                private var fileRef:FileReference;
                private var urlReq:URLRequest;
                 * Constant values for user manual pdfs
                private static const PDF_STRING:String = "blahblahblah.pdf";
                private function init():void
                    /* Define file reference object and add a bunch of event listeners. */
                    fileRef = new FileReference();
                    fileRef.addEventListener(Event.COMPLETE, completeHandler);
                    fileRef.addEventListener(Event.OPEN, openHandler);
                    fileRef.addEventListener(ProgressEvent.PROGRESS, progressHandler);
                private function doEvent(evt:Event):void
                    /* Create shortcut to the FileReference object. */
                    var fr:FileReference = evt.currentTarget as FileReference;
                    try
                        /* Update the Model. */
                        fileRefModel.creationDate = fr.creationDate;
                        fileRefModel.creator = fr.creator;
                        fileRefModel.modificationDate = fr.modificationDate;
                        fileRefModel.name = fr.name;
                        fileRefModel.size = fr.size;
                        fileRefModel.type = fr.type;
                        /* Display the Text control. */
                    catch (err:*)
                        /* uh oh, an error of sorts. */
                private function downloadPDF(url:String):void
                    /* Begin download. */
                    urlReq = new URLRequest(url);
                    fileRef.download(urlReq);
                 * When the OPEN event has dispatched, change the progress bar's label
                 * and enable the "Cancel" button, which allows the user to abort the
                 * download operation.
                private function openHandler(event:Event):void
                    downloadStatusContainer.visible = true;
                    downloadStatusContainer.includeInLayout = true;
                    downloadProgressBar.label = "DOWNLOADING %3%%";
                    cancelButton.enabled = true;
                 * While the file is downloading, update the progress bar's status.
                private function progressHandler(event:ProgressEvent):void
                    downloadProgressBar.setProgress(event.bytesLoaded, event.bytesTotal);
                 * Once the download has completed, change the progress bar's label one
                 * last time and disable the "Cancel" button since the download is
                 * already completed.
                private function completeHandler(event:Event):void
                    downloadStatusContainer.visible = false;
                    downloadStatusContainer.includeInLayout = false;
                    downloadProgressBar.label = "DOWNLOAD COMPLETE";
                    cancelButton.enabled = false;
                 * Cancel the current file download.
                public function cancelDownload():void
                    fileRef.cancel();
                    downloadProgressBar.label = "DOWNLOAD CANCELLED";
                    cancelButton.enabled = false;
                    downloadStatusContainer.visible = false;
                    downloadStatusContainer.includeInLayout = false;
            ]]>
        </mx:Script>

    The tick counter has a resolution of 1 ms.  Resolution, accuracy, and the responsiveness of the OS are three different things.  The issue is that OS latency can be 10s of milliseconds or occasionally longer.  If the OS decides to index the hard drive between the time you read the tick count and send the start audio command, your tone could be quite late. Sending the TTL pulse is a third call to the OS.  So you have two latency times for each trial. Unless you have a real-time operating system, this latency issue will introduce randomness into your data.
    Try sending TTL pulses of 50 ms duration every 200 ms, software timed, for a few minutes and look at the variation in the edge timing.  Then try it again with tones thrown into the mix and see if the variation changes. 
    That is where hardware timing and synchronization pays off. 
    Lynn 

  • FileReference#download() and filename question

    On the server side I set a HTTP header as
    Content-Disposition: attachment; filename=myfilename.txt
    Is it possible to get this information in Flex client? The FileReference#download() function gives a possibility for a name to set on the file browser, but I can't figure out how to get it from the server. By default, the function uses the remote URL.
    Any ideas?
    Thanks.

    Lawcats please see Install and update apps - https://helpx.adobe.com/creative-cloud/help/install-apps.html for information on how to install the Adobe Creative applications included with your membership.

  • Btn to Cancel FileReference download

    Hi, I can't figure out how to make a button cancel downloads
    started using FileReference. Below is the code that is used to
    start the download. If you could let me know the right code to put
    in the on(release) of my cancel button that would be great. I've
    spent so much time trying to figure this out, and I just can't get
    it. Thanks!
    import flash.net.FileReference;
    var listener
    bject = new Object();
    listener.onCancel = function(file:FileReference):Void {
    //the code for what to do when user hits cancel on dialogue
    box
    listener.onOpen = function(file:FileReference):Void {
    //etc etc these listeners go on
    };

    Sorry that I was not able to successfully provide an answer.
    As I said I use Windows, but I would have expected the functionality to be very similar with Linux.
    I am having difficulty understanding
    *exactly what it is that you are attempting to do,
    *and why you consider Firefox's behaviour to be anything other than as expected.
    Someone else may understand better, and it may help if you give a specific example.
    * explain what sort of material you are trying to download, eg computer programmes, video etc
    * what site you are using, with the name and the correct link
    * an example file you tried, again with name and link <br/>(it would help if you give examples of free publicly accessible sites and files)
    # explain what you did and what happened
    # explain what the expected behaviour was
    # explain why you think something is wrong
    There is always the possibility using specialist download managers but that is outside the scope of this forum.
    '''Did you read the information shown by the blue clickable links in my first message ?'''
    * specifically https://support.mozilla.com/en-US/kb/Downloads%20window#w_what-can-i-do-with-the-downloads-window
    Part of which is
    ''"Remove the file's entry: If you do not wish to keep a record of a particular download, simply right-click the file entry, then select Remove From List (This will remove the entry from the list; it will not delete the file itself). "''
    That also lists and explains: Pause, Cancel, Open the file, Open the file's folder, and Retry a download.

  • Adobe air on iOS - FileReference Download Error

    I guys,
    when I use the Download method of the FileReference class, everything works fine on Desktop and Android, but I get an error on iOS.
    This is the code:
    var req = new URLRequest(url);
    var localRef:FileReference = new FileReference();
    localRef.download(req);
    On iOS I'm getting an Alert:
    Download Error
    File downloads not supported.
    I already tried to NavigateToUrl() and it asks save the file in Dropbox or another App.
    How can I fix this error?
    Thanks!

    What are you intending to do with the downloaded file? Will it be used solely by the app, or you attempting to download some othe media (photo, video, music, etc.) to be referenced outside the app.
    If you want to do the former I think I can help...
    The later, I am not sure how to, or if you can, do.

  • Downloading Images - FileReference download error 2176

    Hi everyone.
    I'm trying to download some images but getting this error "Error #2176: Certain actions, such as those that display a pop-up window, may only be invoked upon user interaction, for example by a mouse click or button press."
    The trouble is, it IS running off a button click - just indirectly.
    I'm trying to design a good architecture for my program, so have the Application, a dataStore and some value objects, for example, a pricebook containing and array of products, each called PricebookVO and ProductVO.
    What I'm doing when the application loads is doing a database query with another API that gives me a pricebook and all of its products, and i populate the value objects.  Relationship is obviously  PricebookVO -< ProductVO.  I wanted to download the images for the products at the same time but it won't let me due to the error above, so what I have now is a button bar and when the user clicks a button an event is bubbled up to the Application which changes the page, but what also happens is it checks to see if the user has clicked the Products button and if it has, it tells the PricebookVO to tell each of its ProductVO's to download their image (from a URL that was saved from the query.
    Presumably the error im getting now is because the download is not directly summoned by a user event but by an indirect event (ie user pushes button, code calls code which tries to download the file).  How can I download the images and still maintain my architecture?
    Also, am I getting confused?  I want to get a file from a server and save them in an mx.controls.Image on the ProductVO record, do I use the FileReference.Download method or something else?  Because on further inspection it looks as though the download method is for downloading something to the local machine with a download dialog box?
    Thanks
    Steven

    Thanks for all your help Peter, its much appreciated.  I hate that useless feeling when learning a new language!
    So anyway, I was initially using image.source but thought to myself that's probably referencing the image from its server source which might be quite a hog, so wanted to store it myself, but if you say image.source does indeed handle the image itself and not just reference it from the source, thats good.
    My only remaining query is regarding how it is displaying.  I have a tileList which is rendering the images and it does work, however the images are loading on screen as I watch them, and if I scroll I then have to wait again whilst the images load.  If I then scroll back to the previuos part of the screen, where the images had previously already loaded, they have disappeared again and I once again have to wait for them to load.
    I know normally you'd embed them, but dont see how thats possible with the way I'm having to load them from the server?
    I have a method in my datastore like this:
    public function getProds():ArrayCollection{
    var imgs : ArrayCollection = new ArrayCollection();
    for each (var pb : PricebookVO in pricebooks){
      pb.getProdCount();
      for each (var p2 : ProductVO in pb.products){
       imgs.addItem(p2);
    return imgs;
    and in my products page:
    <mx:TileList>
      <mx:width>100%</mx:width>
      <mx:height>100%</mx:height>
      <mx:itemRenderer>components.Thumbnail</mx:itemRenderer>
      <mx:dataProvider>{DataStore.getInstance().getProds()}</mx:dataProvider>
    </mx:TileList>
    components.Thumbmail is
    <mx:Image>
      <mx:width>100</mx:width>
      <mx:height>75</mx:height>
      <mx:source>{this.data.image.source}</mx:source>
      <mx:toolTip>{this.data.prodCode}</mx:toolTip>
    </mx:Image>
    So, how can I stop the tilelist from having to constantly reload the images?  I get the impression that the solution might end up using a lot of memory to store the images somehow, so advice on the best way to do this is appreciated.
    Thanks!

  • FileReference.download headache

    Hey everyone!
    Been trying to get a button in my flash site to download a
    file using FileReference. I get the download window and all but it
    just won't download anything at all. Now I know a lot of people
    have asked this before but seems no one ever got a half decent
    reply that would actually help to resolve this issues. So I hurge
    those who know how this works to post replies and give all those of
    us "newbies" a chance to learn and stop bothering you with the same
    stuff over and over.
    This is a cry for help from lots of users out there.

    you probably have a security violation. use a local path, if
    that file is local to the server hosting your flash files, or you
    need need a cross-domain policy file.

  • FileReference.download Failing

    I'm trying to use FileReference.download for a user to
    download a file. (obviously)
    It's working just fine, for probably 99% of our users.
    However, for one user in particular, the "Save As..." dialog box
    never appears. Does anybody know of any firewall/anit-virus/other
    security settings that could block this? It's happening in FF 2.0
    and IE 6, with Flash Player 9.

    Have the one user use another machine in their location to
    see if it is consistent inside their network or the user's machine.
    Also have them right click over the app to be sure they have
    the correct version of the Flash player.

  • FileReference download location

    Hello,
    Is possible retrieve the location of a file downloaded with the FileReference.download() method? After the user receives the prompt to download and selects a location I would like to be able to retrieve that location.
    Thanks,
    Scott

    for a web-based app it only works in response to a user even like a mouse click or keyboard event. 
    When you use this method , consider the Flash Player security model:
    Loading operations are not allowed if the calling SWF file is in an untrusted local sandbox.
    The default behavior is to deny access between sandboxes. A website can enable access to a resource by adding a URL policy file.
    You can prevent a SWF file from using this method by setting the  allowNetworking parameter of the the object and embed tags in the HTML page that contains the SWF content.
    In Flash Player 10 and Flash Player 9 Update 5, you can only call this method successfully in response to a user event (for example, in an event handler for a mouse click or keypress event). Otherwise, calling this method results in Flash Player throwing an Error exception.

  • FileReference.download in linux

    Hi All
         I am developing an application to use in both linux(ubuntu) and windows.
         In that i am using FileReference.download to save the file locally in windows but this is not working in linux.
         Is there any other possibilities(method) to save the file locally in both linux and windows?
         Please someone help me..
    Regards
    Preethee L

    Hi Preethee,
    Can you post the code snippent used in the application for saving the file
    I have tried following code on my Linux box (Ubuntu 10.10) and its working fine. This saves the file in documents folder of the user machine
                    var f = new FileReference();
                    try {
                        f.download ( new URLRequest ( "http://servername/download.text" ), "foo.txt" );
                    catch (e:Error)
    thanks
    Ashish

  • Filereference download issue on some browsers

    Hi, Im having a filereference download issue which is turning
    out to be rather elusive. I have it working great on my comp in ie,
    however on my comp with firefox, or with any browser on my father's
    computer we get the file browser popup and when we hit "save"
    everything SEEMS to go OK but the file doesnt get downloaded. Weve
    checked and re-installed all the browsers / flash plugins, and
    nothing has changed. No error handelers get tripped, and Ive
    checked the scope issue. The following is the code Im using,
    published to flash 8 AS 2.
    import flash.net.FileReference;
    _root.vars.fileRef = new FileReference();
    _root.functions.getit = function(){
    _root.vars.fileRef.download("
    http://www.myURL.com/myList.csv",
    "myList.csv")
    Thanks for your help.

    an absolute path would be something like:
    www.yourdomain.com/subdirectory/yourfile.ext
    (looking at the op's original message, i see he used an
    http:// prefix which isn't going to work in any
    case.)
    a relative path from yourdomain's main directory would be:
    subdirectory/yourfile.ext

  • Default extension in FileReference.download

    As part of my Flex application users can save their work to a text file on their local machine.  They can then later load these files.
    Both loading and saving use a FileReference object, and bounce the files off the server as needed.
    It all works pretty well, but the problem is that if the user decides to overwrite the filename there is the very real possibility that they will forget to add the extension.
    For example, the default name comes up as "untitled 1.txt", and they just type "myfile".
    The result is that when they then go to load the file it does not appear - because I am filtering for just ".txt" files.
    It's pretty normal in a Windows application to automatically append a default extension, but I can see no equivalent in Flex.
    Is this something that can be done?
    If not are there any good workarounds?
    Thanks

    It's disappointing that it doesn't have the option to add an extension.  I can possibly understand if it disallowed ".exe" as a default, but apart from that I can see no good reason for this omission.
    In the end I just added a SELECT listener, where I check the saved name, and if the extension is missing I warn the user that they should go and rename the file.
    It's a bit clumsy in my opinion, but because the SELECT event comes AFTER the file has been saved, there's no way to cancel the download, so a warning seems like the best that can be done.

  • Apply FileFilter for FileReference Download file

    I want to apply particular File Filter for FileReference
    class when i am downloading file.
    When i download my file it should be save in XML format only.
    How can i do this?
    Thanks,
    Nirav

    Hi Bonnie,
    when using download:
    http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/FileReference .html?#download()
    2038 IOError would be returned - at least as far as I can tell - if server returns:
    HTTP/1.1 404 Not Found
    status code that error would be thrown and then dispatched (but it won't contains 404 specific information - instead some general IO error for server url will be provided). So add IOErrorEvent.IO_ERROR to your FileReference instance - that is something you could try,
    hth,
    kind regards,
    Peter

  • Pb with FileReference.download() function

    Hi,
    Can anyone tell me why this simple code makes the navigators
    crash ?
    IE and Firefox just disappear from my windows task bar...
    private var fileRef:FileReference ;
    private function file_download():void{
    var request:URLRequest = new URLRequest();
    request.url = "
    http://www.logitweb.com/download/file.txt"
    fileRef=new FileReference();
    fileRef.download(request,"myFile.txt");
    You can try the SWF at this address :
    http://www.logitweb.com/download/
    Thanks
    Jean

    Hi,
    Can anyone tell me why this simple code makes the navigators
    crash ?
    IE and Firefox just disappear from my windows task bar...
    private var fileRef:FileReference ;
    private function file_download():void{
    var request:URLRequest = new URLRequest();
    request.url = "
    http://www.logitweb.com/download/file.txt"
    fileRef=new FileReference();
    fileRef.download(request,"myFile.txt");
    You can try the SWF at this address :
    http://www.logitweb.com/download/
    Thanks
    Jean

Maybe you are looking for

  • Is there an AUDIT option like AFTER SERVERERROR database trigger?

    I want to log any and every error-exception in a test database for a period. I have seen DBMS_UTILITY.FORMAT_ERROR_BACKTRACE article published on Oracle Magazine; http://www.oracle.com/technology/oramag/oracle/05-mar/o25plsql.html But before trying t

  • Set maximum record time?

    Can I set maximum record time in Logic 8? Recording an hour-long live program unsupervised, & I'd like it to stop afterwards. (I don't know any problem with continuing recording for hours until the hard drive is full? But it's not necessary.) thanks

  • Cracked screen on ipad2 need to get fixed cheap

    i need to get my  ipad screens fixed cheap where do i go

  • How can I simulate perspective on an object?

    The top object in the attachment is the image I am trying to re-create and I can't for the life of me figure out how to get the ACHA logo to look like it's "placed" on the top of the puck and give it some perspective? The bottom image is what I've cr

  • Map Render  Problem !!!

    Hi. I´m using Web Template to generate Maps in BW 3.5. The formatting option that was set is "###.###,##" All is ok if i use low KF (until 999) but when the result is higher the system render the Map with HTML format "###,###.##". For example : The v