Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

How do you get adobe air to save a file inside a folder that's inside the documents folder?

New Here ,
Aug 28, 2018 Aug 28, 2018

How do you get adobe air to save a file inside a folder that's inside the documents folder?

I know how you get adobe air to create a folder inside the documents folder.

import flash.filesystem.*;

// go to documents folder and create a folder caller Test Folder
var dir:File = File.documentsDirectory.resolvePath("Test Folder");
dir.createDirectory();

but I can't figure out how to save text file inside of the folder that was made.

This doesn't work...

// save file to to Arthur Test folder
    var string:String = "Text";
    var file:File = File.documentsDirectory.resolvePath("myTxtFile.txt");

   
    var stream:FileStream = new FileStream();
    stream.open(file, FileMode.WRITE);
    stream.writeUTFBytes(string);
    stream.close();

it only saves the file inside the documents folder

how do i get it save inside the folder inside the documents folder?

1.1K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Aug 28, 2018 Aug 28, 2018

use

var file:File =dir.resolvePath("myTxtFile.txt");

Translate
Community Expert ,
Aug 28, 2018 Aug 28, 2018

use

var file:File =dir.resolvePath("myTxtFile.txt");

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 28, 2018 Aug 28, 2018

Thank you!!! It worked!!!

Actually, Thank you TWICE!!!

Thank you for the answer and thank you for the quick reply!

I would have never figured out that was the answer!

Again thank you!!! Now I can finish my project!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 28, 2018 Aug 28, 2018
LATEST

you're welcome.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines