Where is applicationstoragedirectory flex




















These properties have different values on different operating systems. However, the File. To write applications that work well across platforms, use these properties as the basis for referencing other directories and files used by the application. Then use the resolvePath method to refine the path. For example, this code points to the preferences. Although the File class lets you point to a specific file path, doing so can lead to applications that do not work across platforms.

For these reasons, it is best to use the static properties of the File class, such as File. The actual native paths for these directories vary based on the operating system and computer configuration.

The paths shown in this table are typical examples. You should always use the appropriate static File class properties to refer to these directories so that your application works correctly on any platform. In an actual AIR application, the values for applicationID and filename shown in the table are taken from the application descriptor. If you specify a publisher ID in the application descriptor, then the publisher ID is appended to the application ID in these paths.

The value for userName is the account name of the installing user. You can point a File object to the user's documents directory. The following code sets a File object to point to an AIR Test subdirectory of the documents directory:.

You can point a File object to the desktop. You can point a File object to the application storage directory. For every AIR application, there is a unique associated path that defines the application storage directory.

This directory is unique to each application and user. You can use this directory to store user-specific, application-specific data such as user data or preferences files. For example, the following code points a File object to a preferences file, prefs.

The application storage directory location is typically based on the user name and the application ID. The following file system locations are given here to help you debug your application. You should always use the File. AIR 3. You can point a File object to the directory in which the application was installed, known as the application directory.

You can reference this directory using the File. You can use this directory to examine the application descriptor file or other resources installed with the application. For example, the following code points a File object to a directory named images in the application directory:.

This directory contains temporary files that are not required for the application to run and will not cause problems or data loss for the user if they are deleted. In most operating systems the cache directory is a temporary directory.

For more information, see Controlling file backup and caching. The File. The StorageVolumeInfo. You can point the File object to an explicit directory by setting the nativePath property of the File object, as in the following example on Windows :.

Important: Pointing to an explicit path this way can lead to code that does not work across platforms. For example, the previous example only works on Windows. You can use the static properties of the File object, such as File. Then use the resolvePath method see the next section to navigate to a relative path. You can use the resolvePath method to obtain a path relative to another given path.

For example, the following code sets a File object to point to an "AIR Test" subdirectory of the user's home directory:. You can also use the url property of a File object to point it to a directory based on a URL string, as in the following:.

For more information, see Modifying File paths. The File class includes the browseForDirectory method, which presents a system dialog box in which the user can select a directory to assign to the object. The browseForDirectory method is asynchronous. The File object dispatches a select event if the user selects a directory and clicks the Open button, or it dispatches a cancel event if the user clicks the Cancel button.

For example, the following code lets the user select a directory and outputs the directory path upon selection:. You can get the directory location from which an application is invoked, by checking the currentDirectory property of the InvokeEvent object dispatched when the application is invoked.

For details, see Capturing command line arguments. Important: Pointing to an explicit path can lead to code that does not work across platforms. Then use the resolvePath method see Modifying File paths to navigate to a relative path. You can use the url property of a File object to point it to a file or directory based on a URL string, as in the following:.

You can also pass the URL to the File constructor function, as in the following:. You can also use the nativePath property of a File object to set an explicit path.

For example, the following code, when run on a Windows computer, sets a File object to the test. You can also pass this path to the File constructor function, as in the following:.

You can use the getDirectoryListing method of a File object to get an array of File objects pointing to files and subdirectories at the root level of a directory. For more information, see Enumerating directories. The File class includes the following methods that present a system dialog box in which the user can select a file to assign to the object:.

These methods are each asynchronous. The browseForOpen and browseForSave methods dispatch the select event when the user selects a file or a target path, in the case of browseForSave.

With the browseForOpen and browseForSave methods, upon selection the target File object points to the selected files. The browseForOpenMultiple method dispatches a selectMultiple event when the user selects files. The selectMultiple event is of type FileListEvent, which has a files property that is an array of File objects pointing to the selected files.

If the application has another browser dialog box open when you call a browse method, the runtime throws an Error exception. You can also modify the path of an existing File object by calling the resolvePath method or by modifying the nativePath or url property of the object, as in the following examples on Windows :. Use to specify a path relative to the root directory of the installed application the directory that contains the application. Learn more. Ask Question.

Asked 8 years, 4 months ago. Active 7 years, 6 months ago. Viewed 2k times. Add a comment. Active Oldest Votes. Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password. Viewed 2k times. WRITE ; fs2. Which OS as you testing? Ok, I misunderstood your question initially. This also applies to sqlite files. First — Adrian Pirvulescu.

Add a comment. Active Oldest Votes. Solved the issue So when you had things over to the default browser it can't find the file.

Remember that you need to specify this for IOS and Android specifically. Robin van den Bogaard Robin van den Bogaard 2 2 silver badges 7 7 bronze badges. Douglas da Silva Douglas da Silva 3 1 1 bronze badge. CyanAngel CyanAngel 1, 1 1 gold badge 14 14 silver badges 26 26 bronze badges.

Sign up or log in Sign up using Google. Sign up using Facebook. Sign up using Email and Password. Post as a guest Name. Email Required, but never shown.



0コメント