Accessing data and files (Windows Store apps using JavaScript and HTML)

Language: JavaScript and HTML | VB/C#/C++ and XAML
5 out of 8 rated this helpful - Rate this topic

Access files, folders, and data from your Windows Store app.

File access through file pickers

Get started:
Quickstart: Accessing files with file pickers
How to save files through file pickers

File pickers give users explicit control over which files and folders your app can access, and give you an easy way to let users specify the name or location of a file to save. Call the file picker to let your users choose the files and folders that they want your app to work with. (And when the user gives your app access to a folder through the file picker, your app also gets access to that folder and all of its subfolders.)

If your app works with individual files or small lists of files, like most apps, these file picker interactions may be all you need to access files and folders for your app. If you don't need additional file system access, you can minimize your app's capability declarations and potentially simplify the review process when you submit your app to the Windows Store. See File access and permissions in Windows Store apps to learn more about default file system permissions and the file picker.

For example, in this screen shot an email app called the file picker so that the user could choose a picture from the Pictures library.

A screen capture of a file picker with one file in the Pictures library selected to be opened.

And in this screen shot the Reader app called the file picker so that the user could specify the file name and location of the file to save.

A screen shot of a file picker used to save a file to SkyDrive.

Programmatic access to files

Get started:
Quickstart: Accessing files programmatically

If your app has permission to access files and folders in a particular location, you can enumerate and access all the files in that location. See File access and permissions in Windows Store apps to learn which locations your app has access to automatically, and learn about ways your app can gain access to additional locations.

Access to app files and data

Learn more:
Managing application data
Defining app resources
How to load file resources
How to perform rich queries on app local data

All apps can store and manage app-specific files and data on the local file system or the cloud, including resource files in the app package.

Read or write file data

Get started:
Quickstart: Reading and writing a file

You can read and write data to a file directly or by using streams.

Retrieve data from data sources

Learn more:
Working with data sources

Apps can use data sources to retrieve data from underlying sources, such as databases, files, or RSS feeds. A data source can manipulate the data and display it in controls such as ListView or FlipView.

In this section

TopicDescription

Quickstart: Accessing files with file pickers

Access files and folders through the file picker by letting users pick files and folders. You can use the fileOpenPicker class to gain access to files and the folderPicker to gain access to folders.

Quickstart: Accessing files programmatically

Access files and folders that are in a location like a folder, library, device, or network location. You can also query the files and folders in a location by constructing file and folder queries.

Quickstart: Reading and writing a file

Read and write a file using a StorageFile object.

Quickstart: Accessing HomeGroup content

Access content stored in the user's HomeGroup folder, including pictures, music, and videos.

How to save files through file pickers

Use fileSavePicker to let users specify the name and location where they want to save your app’s content.

How to track recently used files and folders

Track files that your user accesses frequently by adding them to your app's most recently used list. Windows manages the mostRecentlyUsedList for you by sorting items based on when they were last accessed and by removing the oldest item when the list's 25-item limit is reached. All Windows Store apps have their own mostRecentlyUsedList.

Guidelines for file pickers

Follow these guidelines to customize the file picker when you use the file picker to access files and folders or when you use the file picker to save files.

Integrating with file picker contracts

Working with data sources

Learn about the different types of data sources provided by the Windows Library for JavaScript.

 

Related topics

File access sample
File picker sample

 

 

Build date: 3/4/2013

Did you find this helpful?
(1500 characters remaining)
© 2013 Microsoft. All rights reserved.