Organizational Research By

Surprising Reserch Topic

Saving picked photo to a local file using file picker

I am developing a windows 8 store app, I need to let the user to pick a photo and save it to a local folder, I already managed the saving method in a JSON file, and I know how to work with picker

       FileOpenPicker openPicker = new FileOpenPicker();
            openPicker.ViewMode = PickerViewMode.Thumbnail;
            openPicker.SuggestedStartLocation = PickerLocationId.PicturesLibrary;
            StorageFile file = await openPicker.PickSingleFileAsync();

is it possible to add the picked photo to the Assets folder to be permanently there ? if yes, please help, if no, please help :D Thanks

asked Sep 13, 2013 in Microsoft Window 8 by rajesh
edited Sep 12, 2013
0 votes

Related Hot Questions

1 Answer

0 votes
No, the Assets folder (assuming you mean the default folder you typically get with a Windows Store project) is part of the application package and read only. Essentially you can only read from URLS preceded by ms-appx:// You can save to local storage (ms-appdata:///local/) and it will be persistent there as well (unless you explicitly remove it). The following line after your code will save to the top level of local storage await file.CopyAsync(ApplicationData.Current.LocalFolder) Use CreateFolderAsync or GetFolderAsync if you want to store to a folder not directly at the root of your application data.
answered Sep 13, 2013 by rajesh
edited Sep 12, 2013