Downlaod link in Adobe Air in Documents folder automatically without pop up dialog box...

Hello

Can someone help me understand or provide a code example on the method, I would need to take to download a file from the internet and automatically that Adobe Air stores this file somewhere on my computer (probably the Documents folder) and also not pop-up that keep in dialog?

I'm downloading a file very well now, but the main problem is that the pop-up window comes up and ask me where I want to save the file. I didn't need to do that. I want to automatically record in a directory on my computer.

Thank you guys

A long time ago when I was first in the AIR, I created a downloader application to do essentially what you ask for. Here is the code for the part you need to download and save a file. If the file you download is generated dynamically, or has links to specific reference, you will have to do something fancy to know the file extension to know what should be the full file name. I just tested the code for download of an image and the file for the FileStream ASDoc HTML

import flash.events.Event;
import flash.filesystem.File;
import flash.filesystem.FileMode;
import flash.filesystem.FileStream;
import flash.net.URLRequest;
import flash.net.URLStream;
import flash.utils.ByteArray;

var documentsDirectory:File = File.documentsDirectory;// active user documents directory
var fileName:String;
var fileToSave:File;
var fileStream:FileStream;
var fileData:ByteArray;

var urlRequest:URLRequest = new URLRequest("http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/filesystem/FileStream.html");
var urlStream:URLStream = new URLStream();
urlStream.addEventListener(Event.COMPLETE, onDownloadComplete);
urlStream.load(urlRequest);

function onDownloadComplete(e:Event):void {
  // get the index position of the last forward slash in the file path
  var startIndex:int = urlRequest.url.lastIndexOf("/") + 1;

  // set fileName equal to url string starting after the last forward slash
  fileName = urlRequest.url.substring(startIndex);

  // create a new File object at the user Directory folder with the correct file
  fileToSave = documentsDirectory.resolvePath(fileName);name

  // create ByteArray to store data downloaded from URLLoader
  fileData = new ByteArray();

  // write the data from URLLoader to ByteArray
  urlStream.readBytes(fileData, 0, urlStream.bytesAvailable);

  // create FileStream to save data to File
  fileStream = new FileStream();

  // open file in a WRITE mode to save data to the File
  fileStream.open(fileToSave, FileMode.WRITE);

  // write the data to the file
  fileStream.writeBytes(fileData, 0, fileData.length);

  // close FileStream when done
  fileStream.close();
}

Tags: Adobe AIR

Similar Questions

  • How can rejection of the Amazon - the link to Adobe AIR in your app update needs - I change this

    Here is a message I received from Amazon:

    Unit tested : Motorola Droid (2.3), HTC Evo (2.3.3), Samsung Galaxy Tablet (2.2)

    Question : The link in your Adobe AIR application must be updated so that visitors are taken directly to the page of Adobe AIR app on the Amazon Appstore. The download URL is http://www.amazon.com/gp/mas/dl/android?p=com.adobe.air steps: I) launch the application. (II) press 'Install' > > «Appstore» Observe that the application accesses the home page of the Amazon app store for Adobe Air installation.

    I'm guess I could change this in my xml file:

    I change the URL in this line than what they provided (http://www.amazon.com/gp/mas/dl/android?p=com.adobe.air):

    <? XML version = "1.0" encoding = "UTF-8" standalone = 'no '? >

    " < application xmlns =" http://ns.Adobe.com/air/application/2.6 ">

    However, when it is published it always changes it back to the old address. How to prevent this?

    Thank you.

    I think I found the couresty of Benny 7500 response on August 11, 2011 09:18.

    For me the work of editing the file Markets.xml to:

    "C:\Program Files\Adobe\Adobe Flash CS5.5\en_US\Configuration\Android\Markets.xml"

    and the replacement of key of Amazon Appstore

    http://www.Amazon.com/GP/MAS/DL/Android?p=com.Adobe.air"/ >

    That's all!

  • Click on a .pdf link does not open the .pdf file, it opens a SAVE DIALOG box

    Recently, when I click on a link to .pdf file I'm not able to open the file in an adobe reader or a FIREFOX Web page or open it using the full program from adobe. Instead, it opens a dialog box SAVE asking me to save it on my hard drive. I don't know what happened, and I'm trying to find someone who might know what is happening?

    I had the same problem, but I got by the following methods:

    Go to Firefox > Options > Applications > Portable Document Format (PDF)

    And for the Portable Document Format (PDF) set the State as "use Adobe Acrobat (in Firefox).

    Fact

    Now the PDF opens in the Firefox browser without having to download the file to open.

  • Adobe application support files of missing files in the dialog box?

    I get a dialog box when I open PS CC 2015 that a file (s) is missing from the Adobe Application support folder is missing. I click ok and PS CC 2015 seems to work very well. This is a new message that just popped up. The dialog box also tells me to reinstall the PS... Comments?

    I tried again. I uninstalled the CC PS, then leave CC. reinstalled the link CC and CC PS, 2015. Who took care of the problem!

  • Photoshop CS6: Change the default resolution for the 'Document size' in the Image Size dialog box?

    I have a Canon EOS 40 d, Photoshop CS6 and Adobe Bridge CS6.  I shot everything in RAW.


    When it's time to change the images, I start by opening in RAW using Adobe Bridge.  When I finished to make adjustments, I click the button open an Image that contains the image to Photoshop.  When I put them to the top of the dialog box size of the Image, the size of the Document is still 240 DPI.


    Is it possible to change this default?  If so, how?

    Click on the text in blue at the bottom of the Camera raw window and change the ppi there.

  • How can I disable Adobe Reader to open a PDF with a print dialog box automatically?

    When I open a PDF file, Adobe Reader automatically assume I want to print the document by opening the screen of the print dialog box.  How can I disable this function?

    Hi danielh1990,

    It can be done because of some javascript embedded in the PDF file.

    The best way to confirm who is disable JavaScript option under ' Edit > Preferences > JavaScript "and then try to open the file again.

    Let me know how it goes.

    Kind regards

    Ana Maria

  • Impossible to synchronize the folder unless 'See the improt dialog box before importing' is controls why?

    Synchronize folders only works if I 'See the import dialog box before importing' checked elsenever locates all the new files.

    Any ideas?

    Dave

    Hey big blue,

    This is a known problem with the latest version of Lightroom.

    Please click the link: sync folder fails with the error ' no photos or videos not found to import "

    Kind regards
    Tanuj

  • 3.6.14 Firefox no longer allows bookmarks to be saved in a folder. the pop-up dialog box no longer appears.

    Updated Firefox to update last night at 3.6.14. Now when I try to save a new bookmark, if it saves at all, it records just in the bookmarks folder. No popup to allow more records in another file. I use Windows 7 Home Pro.

    You have this problem when running in Firefox SafeMode?

    http://support.Mozilla.com/en-us/KB/safe+mode

    Do not choose anything at the moment, just use 'continue in safe mode.

    If this is not the case, see this:

    http://support.Mozilla.com/en-us/KB/troubleshooting+extensions+and+theme...

  • How to save documents CS4 CS5 without save as dialogue?

    My college, they have CS4 (suite) and at home I have CS5 (design premium). I can save files in CS5 as CS4 so they can be read at the College (in Flash), but I have to do it via the "save under" whenever I have save. After a couple of times, it gets rather irritating. Is it possible for me to register in the usual way (as if it were a document of CS5) without save as dialog box whenever I save my work?

    You can.  I don't think you got my point.  Just press Ctrl + S, and when you receive this warning the first time you do this, just select the save option to save it in a file of CS5.  From there you can Ctrl + S without this warning appears, save as a CS5 file each time.  Then when you're ready to send / bring a copy to school, use Save as (or Ctrl + Shift + S) and save it as a file in CS4.

  • Confused of Adobe Air 4.0 or Adobe Air 14?

    When I publish an Adobe using the Flash application, I select Air 3.4 desktop. I want to download the latest version of this, I think it can be called an SDK, or perhaps a compiler, but I'm not sure.

    I've seen links for Adobe Air SDK 4.0 and Adobe Air SDK 14

    I'm a bit confused with the numbering of Adobe.

    Can someone explain what's the difference between:

    Adobe AIR SDK Windows (188 MB) 4.0.0.1628

    Adobe AIR SDK Windows (208 MB) 14.0.0.137

    Adobe AIR SDK 4.0.0.1628 & compiler Windows (224 MB)

    Adobe AIR SDK 14.0.0.137 & compiler Windows (244 MB)

    Adobe AIR 14.0.0.110 Windows (17.8 MB)

    Software development kits, Runtimes, compilers, players etc... version 4, version 14

    My head is about to explode. I don't think it's me just being stupid, it is quite clearly the same named products here including the number of different version.

    Is this a deliberate confuse ploy

    Adobe has changed the design version number to FP and the same version number of the AIR.

    AIR 14 is the last. In any case you can find the latest version of the sdk here: Download Adobe AIR SDK

  • How about you update that updates Adobe Air first installation?

    It's exasperating to deal with all the trouble the CC updates management. Yesterday, I had confirmed my login three different times for applications of CC, and which is a particular worry since I use a password that I looking for. Muse Adobe updates are very annoying because they trigger a dialog box for Adobe Air installation and that often means stop not only the file I opened that triggered the update notification, but also to close an update of current Muse. Can not you sequence the notice so that updates of Adobe Air to install first? Sometimes the update to Adobe Air shows first, but often not. Or I get two competing dialogues to install Adobe Air.

    Thanks for your comments! We are aware of these conflicts caused by the handler Application CC due because the Muse is an Air application. Please see the following thread - http://forums.adobe.com/thread/1253307.

    We intend to address releases these inconsistencies in one of our next Muse. Sorry for the inconvenience!

    Thank you

    Vinayak

  • File navigation dialog box always returns the application folder, not the one I selected

    My script uses a hardcoded destination path to save files. I want to make it more flexible with a file navigation dialog box.

    The function of file selectDlg seems obvious, but it always returns the location of the folder of Photoshop, not the folder I chose in the dialog box.

    For example:

    var outputFolder = Folder();

    outputFolder.selectDlg ("output :"); folder

    $.write (outputfolder);

    Expected:

    My JavaScript console must declare the file I selected in the system dialog box.

    Actual results:

    Regardless of the folder in which I select in the dialog box, it returns always like:

    /c/program%20Files/Adobe/Adobe%20Photoshop%20CC%202014/tmp00000001

    The directory path is where Photoshop is installed on my computer. The tmp00000001 file seems to come.

    Am I missing something obvious?

    var f = Folder();
    var outputFolder = f.selectDlg("Output folder:");
    $.write(outputFolder);
    
  • Cp9: Linking Ctpv projects through a dialog box pop-up on the main project of captivate.

    I run Windows 7 Professional and my version of Captivate is 9.0.1.320.

    Hi all

    I want to join cptv projects using dialogs pop up on the main captivate project, but I don't know how to do it.

    I know that this idea can be implemented on Captivate, since I saw it on another course online.

    Example:

    1. The hyperlink from the button on slide 1 has opened a pop-up dialogue box that has incorporated an other captivate project (see step 2).

    2. when the user has finished watching the embedded captivate in the pop up dialog box.
    then, it closes the dialog box by clicking the X button and goes back to main captivate project (i.e., slide 1).

    3. what the user sees after closing the popup dialog box.

    You may know how I could do this? Is it advanced actions?

    Thank you very much in advance.

    Kind regards
    Iasmi

    I'm sorry, don't understand. Now you're talking about the incorporation of a Captivate demonstration, the original question was a link to another Captivate file. If you want to integrate a CP-demonstration, convert to mp4 and put it in a video. A demonstration is intended for passive observation, which means that a video would be OK. I would have preferred a video demo of better quality, but it is up to you. This last explanation is different from the first.

  • Links to the Documents folder suddenly broken?

    So I had learned about my computer to play a favorite game and was astounded to see that all of my saved games disappeared suddenly! After exploring a bit I found something even more weird - the link in the start menu in the Documents folder suddenly didn't work.

    After having studied more, I realized the two were linked - the files of game themselves had not been deleted - they were stored in a folder in the My Documents folder, the computer can see somehow is more (unless I went directly to her).

    How can I get my computer to correctly bind to My Documents folder again, please?

    See if this has something to do with it...

    Right click on the Start button > properties > start menu tab > customize > Scroll to Documents...
    A blue dot should be on the screen as a link. If this is not the case, do.

    t-4-2

  • Documents folder deleted in error and start menu link does not work again

    In the folder tree pane (Vista Home Premium) it appeared that I had inadvertently copied double my completed application documents in the foledr of downloads, as it seemed that I had two copies of everything: waste of disk space. So I deleted the subfolder Documents of the record of downloads... and the main Documents folder are missing too! It's all the same thing. I don't understand why. But anyway. It wasn't in the Trash because there had been too much to go over there, so it is all definitely eliminated and lost: more than 8 GB :-(

    Therefore, the Documents link in the start bar stopped working. Even after that I created a new Documents folder in the same location as the original, the link on the start menu does not; When I click on properties for the link, the path is empty, and I can't find a way to save a path to it. Any ideas?

    The Document folder is a special folder that will be created in a special way.  Here is the procedure to correct a record that has not been created properly: http://www.vistax64.com/tutorials/90705-personal-user-shell-folders.html.

    Here is another article on how to restore a missing (like Documents) under Vista personal user folder: http://www.vistax64.com/tutorials/148461-personal-user-folder-restore-missing-folder.html.

    Between these articles, I think you should be able to solve your problem in one way or another.

    =================================================================================================================

    In case you're still interested in trying to retrieve the dossier of Documents initially lost, here are some options you can try:

    If you have Vista Business, Vista Ultimate or Vista Enterprise, you can be lucky.  They have so-called saves shadow copies, which are deleted or modified files that can be recovered in case changes/deletions made by mistake.  http://www.Microsoft.com/Windows/Windows-Vista/features/shadow-copy.aspx more information about how to use this feature to: http://blogs.techrepublic.com.com/howdoi/?p=145.

    If you have Vista Basic or Premium of Vista, shadow copies is not available; However, there is an alternative that is free and the shadow copies feature called Shadow Explorer. http://www.howtogeek.com/howto/windows-vista/recover-files-with-shadow-copies-on-any-version-of-windows-vista/.  Although it will not help you this time, it could very well save you in case this happens again.

    In case this does not work (not all files are available through shadow - it occurs periodically), here are some additional free recovery programs that might help:

    http://www.SnapFiles.com/freeware/system/fwdatarecovery.html (first try Recuva)

    http://www.SnapFiles.com/get/DiskDigger.html (try this second - if this fails too, then the chances of recovery are very slim, but we invite you to try other programs if you want)

    http://www.SnapFiles.com/get/easusdfr.html

    http://www.SnapFiles.com/get/restoration.html

    http://www.SnapFiles.com/downloads/Recuva/dlrecuva.html

    http://www.SoftPerfect.com/products/FileRecovery/

    http://techpaul.WordPress.com/2008/06/23/how-to-recover-your-lost-files/

    The files are not really deleted until they are crushed (although they are no longer available through conventional methods).  If you decide to try these recovery programs, you should stop using your drive hard immediately in order not to replace the data that you are trying to recover.  He slave on another PC and launch the recovery of this PC.  Even now you have definitely lost some of them if you use the same PC.  If you can not do this (slave on another PC), you run the risk of overwriting the data with every action you do on the PC (but you may still be able to recover some or most or even all files - it's a matter of luck).

    Only you can decide if the data is important enough to take the PC to an expert data recovery to recover files (they will have better programs and hardware to do that none of us do, and I've provided above).  Do NOT go to the Geek Squad or one of these centers of store-, they generally don't know what they are doing - it take for expert data recovery.  It will cost you a little and they generally offer no guarantees.  The decision is yours.

    Good luck and I hope this helps!

    Lorien - MCSA/MCSE/network + / has + - if this post solves your problem, please click the 'Mark as answer' or 'Useful' button at the top of this message. Marking a post as answer, or relatively useful, you help others find the answer more quickly.

Maybe you are looking for