HWO to remove the files reside in the File.applicationStorageDirectory?

I created a saveLocally() method to temporarily store the images obtained from the server.

saveLocally(fileName:String,_data:ByteArray):void
{
var file:File = File.applicationStorageDirectory.resolvePath (fileName);
var fileStream:FileStream = new FileStream();
fileStream.open (file, FileMode.WRITE);
fileStream.writeBytes (data, 0, data.length);
fileStream.close ();
}

These files are stored in the «...» C:\Documents and Data Store Data\ImageGallery\Local"

After I closed my application files that are stored in the Local store directory are still available. But to remove these images when I clicked the close button.

Thanks in advance...

Hi Ma'ariv,

Try to save the images in a file instead of save directly to Local storage directory in the path of 'C:\Documents and Data\ImageGallery\Local Data Store'.

If you save them to a specific folder, you can point directly in this folder where images and you can easily remove the content with any problem for the other content in the Local repository.

If you save images directly in your Local Store directory without any subdirectory then it will be difficult for you to remove all the images as you have other content in the Local store as well as your images so you can remove them both and you must point to the file of each image and remove the single image file.

So to avoid this, you can store images in separate folder in your ApplicationStorage directory and delete the content (images) of the folder directly.

So create a pictures folder in the Local store directory and point to this drectoy of Images in your code 'C:\Documents and Data Data\ImageGallery\LocalImages\image1.png Store\'

Change your code as below:

Note: Here File.applicationStorageDirectory itself is the path--> "C:\Documents and Data\ImageGallery\Local Data Store"

No need to use File.applicationStorageDirectory.resolvePath ("Local Store"); or File.applicationStorageDirectory.resolvePath ("ImageGallery");

Try to use debugging as which way you actually get so you know what exactly happening...

public void onclose (): void

{

Folder Images here is the new folder now where your images should be saved.

var myFile:File = File.applicationStorageDirectory.resolvePath ("Images");

If (MyFile.Exists)
{
myFile.deleteDirectory (true);
}

}

Thank you

Jean Claude

Tags: Flex

Similar Questions

  • Can I remove the old update files that have already been applied?

    Good evening! I just a quick may be a dumb question... when I've updated my computer, if I remove the before update... like when a service pack number, as for example I downloaded the number of service pack 2 What do I do with the number of the service pack 1? delete it?

    Depends on the operating system - Windows

    Please note this is only for Windows XP and is not on Vista or Windows 7

    Folders that have uninstall as part of the name (for example $NtUninstallKB282010$ who reside in C:\windows (hidden files) are window Hot difficulty updating folders/files) can be removed safely (providing ever, you wish to uninstall the updates). I recommend you leave these records for a period of at least one month to make sure that the update works correctly.

    These updates can be removed individually or together. To learn more about the update/s go on:
    http://support.Microsoft.com/kb/xxxxxx
    NB: XXXXXX = the actual number, not to mention the "Q" or "Ko."

    Once you have removed the uninstall folders/files, then go to control panel, add/remove programs. Select the title of the corresponding Windows fix on the folder/file of the patch you just deleted, and select Delete. You will get a Windows error. This is because you deleted the uninstall folder/files. Simply choose OK and the entry will be removed from the Add/Remove Programs list.

    Don't NOT delete the folder $ $hf_mig

    Cleaning after installation of SP2
    http://aumha.org/win5/a/sp2faq.php#after

    and/or

    XP SP3: Post Installation Cleanup
    http://aumha.NET/viewtopic.php?f=62&t=33827

    For Vista and Windows 7

    The update uninstall method in Windows Vista is quite different from that in Windows XP.

    Uninstaller for each update folder no longer exists in Vista and the uninstall information is stored by the Volume Shadow Copy service.

    After each update, Volume Shadow Copy service backup only the updated files.

    So with Vista, it's a differential backup, rather than a full backup files for uninstall
    in Windows XP.

    This safeguard mechanism is used to save disk space.

    So basically, you are unable to manually delete the uninstall it from the computer.

    TaurArian [MVP] 2005-2011 - Update Services

  • How to: recover disk space by removing the updates of windows installation files

    Original title : Software updates to XP Pro do take the disk space that can be reclaimed by removing downloaded files?

    I want to recover disk space which can have useless files.  Once an update is installed, the downloaded file can be deleted and if so, where they are on my drive?

    Please note this is only for Windows XP and is not on Vista or Windows 7

    Folders that have uninstall as part of the name (for example $NtUninstallKB282010$ who reside in C:\windows (hidden files) are window Hot difficulty updating folders/files) can be removed safely (providing ever, you wish to uninstall the updates). I recommend you leave these records for a period of at least one month to make sure that the update works correctly.

    These updates can be removed individually or together. To learn more about the update/s go on:
    http://support.Microsoft.com/kb/xxxxxx
    NB: XXXXXX = the actual number, not to mention the "Q" or "Ko."

    Once you have removed the uninstall folders/files, then go to control panel, add/remove programs. Select the title of the corresponding Windows fix on the folder/file of the patch you just deleted, and select Delete. You will get a Windows error. This is because you deleted the uninstall folder/files. Simply choose OK and the entry will be removed from the Add/Remove Programs list.

    Don't NOT delete the folder $ $hf_mig

    Cleaning after installation of SP2
    http://aumha.org/win5/a/sp2faq.php#after

    and/or

    XP SP3: Post Installation Cleanup
    http://aumha.NET/viewtopic.php?f=62&t=33827

    How to recover disk space on a computer running Windows XP with a hard disk of 4 GB or less
    http://support.Microsoft.com/kb/956324

  • How to remove the files SENT in duplicate?

    I have two files sent to my email address. One is a stand-alone file is either a subfolder in gmail. This has caused confusion as messages go to the two records and must be moved or deleted separately.

    Is there a purpose to having two records SENT?

    Can I delete one? If yes how?

    Thanks GeoSing

    Read it back. She says remove the control, as in uncheck.

  • How to remove the downloaded PDF files?

    I use an android phone and can access the PDFs using Firefox, I downloaded but how to remove PDF files, that I can't keep?

    By default, Firefox stores downloads in your device's standard download folder. So here's what I suggest:

    (1) removal of in Firefox: menu > tools > downloads > press and hold the > delete

    (2) check the downloads app system to ensure that it has been deleted physically there as well and, if not, delete it using this application

    To confirm the interaction, you could open the app downloads system first, make sure that the PDF file is there, then delete it to in Firefox and when you return to the downloads application, it should be gone.

    It works on your device?

  • Photos: remove the Raw of a photo file

    Hello

    I shot in Raw + Jpeg, I imported both formats but in my use I didn't need the Raw Photos dabs file.

    How to remove only imported raw files?

    Is it possible to import don't have the jpeg file?

    Thanks in advance for your help.

    Google translation

    Photos: Remove the Raw photo file

    Hello

    I shot in RAW + JPEG, I imported both formats, but in my usage I don't have the raw file keys Photos.

    How to remove import only raw files?

    Is it possible to import have only the jpeg file?

    Thanks in advance for your help.

    You can't really do this - if you do not want RAW do not pull on it - shoot JPEG only

    The only way to do this is to export (menu, file == > export) JPEG images in a folder on the desktop, delete them photo and wait until they are completely removed from all devices and then réimportent just JPEG images

    The only way to import the JPEG is only to use Image Capture and import only JPEG files

    LN

  • How can I remove the background file screen path in El captain

    I had a two years remove the path of the printed file on my wallpaper, I tried all the standard remedies without success.

    Whence is the file?

  • How can I remove the title of the page above the file, Edit, View, history, bookmark tab?

    How can I remove the title of the page above the file, Edit, View, story, tab bookmarks in firefox

    In Firefox, 29 and 30 of Firefox:

    button '3-bar' menu > customize

    Bottom left, click the title bar button to enable and disable the title.

    In Firefox 28, I actually do not remember!

    I would be remiss in my duty if I didn't remind you:

  • Unable to find the file userChrome.css customization of Firefox. I just installed 20.0.1 firefox browser. You want to disable/remove the navigation bar. Pls Hlp

    Unable to find the file userChrome.css customization of Firefox. I just installed 20.0.1 version of the Firefox browser.
    I want to disable/remove the navigation bar of the browser window, making the browser works like the kiosk mode.

    Help, please

    Thank you
    Vishal.

    your profile folder is a subfolder of C:\Documents and Settings\XXXXXXX\Application Data\Mozilla\Firefox\Profiles\ and something like < randomstring > .default label - folder chrome with the userChrome.css file must go in this folder .default < randomstring > .

  • Remove the videos but they still appear in the original file

    I had added a few videos that I deleted from my library of photos using Apple + delete key. They no longer appear in my photos App, however, I noticed that the folder of photos was big enough so I looked inside and my deleted videos still resident in the original folder. Is it safe to just delete the originals of the record? Shouldn't they have been deleted when I removed the app?

    No - it is never safe to make changes to the content of the photo library using the finder

    have you erased them from the album recently deleted too?

    LN

  • How to remove the data files of cRIO

    Please forgive my ignorance, but I don't see how to remove the old a cRIO data files.  I tried to get a functional data logger, and I have some old files of data on the cRIO.  I ftp copies files through IE, but I don't know how to delete the files from the cRIO.

    If you FTP via Windows Explorer, my computer, ftp://adresse IP in the address bar, you should be able to delete the files.

  • Remove the read-only attribute from all files in a folder

    How to remove the read-only attribute from all files in a folder. I tried to use the properties and used the attrib command, but all I see is when I right click on the folder, selecting Properties, it shows once again

    I followed the forums, but I'm really confused. Can someone help me with this. Thanks in advance

    I would like to start by finding which file is read-only again. This is probably a file as well as a miniature file desktop.ini.  An easy way to find it is to go to the details view, turn on the column heading "Attributes" and search for all files with the attribute value "R":

    In this example, the key of SB file is read-only:

  • How to remove image files i've got duplicates when it says I can't do it because the file is open in another program? What does that mean?

    How to remove image files i've got duplicates when it says I can't do that because the folder is open in another program? What does that mean?

    Hello

    • What version of Windows are you using?
    • What were the changes made before the problem occurred?

    Follow the steps in this given link and check if that helps.

    Method 1: check out the link below and follow the steps

    Access the link for more information about the error you receive below:

    Why can't I delete a file or a folder?

    http://Windows.Microsoft.com/en-us/Windows7/why-cant-I-delete-a-file-or-folder

    Method 2: you can also try to remove the file getting mode without failure.

    Access the link below to learn more about Safe Mode:

    Start your computer in Mode safe:

    Method 3:
    Once you face this problem you can check in Manager tasks if there is an executed program attached to it.

    a. right-click on the taskbar and click Task Manager.
    b. in the Windows Task Manager window, go to 'Process' and check if there is no program associated with those files.


     
  • Cannot remove the sharing NFS file after the installation of ForeFront 2010.

    After installing Forefront Endpoint Protection 2010, I am unable to delete files from an NFS Server 2003 share. Before installing, I had no problem, I removed the tip as a test and I was able to delete the file, reinstalled Forefront and was not able to delte the file again.

    You have posted in the forum for Microsoft Security Essentials. Forefront Endpoint Protection has its own forum.

    http://social.technet.Microsoft.com/forums/en-us/FCSNext/threads

    I hope this helps.

  • How to remove the file from Dr. Watson?

    How to remove the Dr. Watson File?

    Hello

    1. which version of the Windows operating system is installed on your computer?

    2. Why do you want to delete file Dr.Watson?

    3. are you face any problem with Dr.Watson?

    4. do you get an error code or error message?

    I suggest you to refer to the following Microsoft article and check if it helps.

    How to disable or enable Dr. Watson for Windows:

    http://support.Microsoft.com/kb/188296

    For more information, see the following Microsoft article.

    How to fix the program with Dr. Watson errors: http://support.microsoft.com/kb/275481

    Hope the information is useful.

Maybe you are looking for

  • Early 2011 MBP battery/SMC issues

    Hello guys I have a problem strange battery with my mbp in early 2011. One day, he suddenly showed an x on the symbol of the battery and after having looked through the forums, I did a reset of the MSC. She failed the first time but then he got runni

  • When I am browsing the internet using Safari and I'm looking for something like a plumber he gives met with responses from an area not my own.  How can I change this?

    When I'm surfing the internet using Safari looking for a product (like a plumber) all my suggestions come from the vicinity of Tyler, Texas.  I live much closer to Dallas.  How can I change that.  Thank you!

  • GPF using the Table control

    Hello world We use a table control to display the log files. Each row of the table represents a log file entry. In addition to that we have put in place Some filter chopsticks (string tonalite) to speed up filtering. This means that only the entries

  • USB charging question

    New Fuze owner here. Love it so far. Question: Is it possible to NOT have the "rocket" USB charge when connected to the computer. Situation: I have completely loaded the "rocket" with a wall adapter. I listened to the radio for some time function, us

  • Adding a wireless laptop

    I have two desktop computers wired through a DSL Modem from Actiontech and a Linksys DSL Router with 4-Port-Switch. I want to add a wireless laptop to the system. Is there a router that works with wired computers and wireless laptop? Concerning Jessi