I have the image URL.
How can I save it into Isolated Storage in WP 8.1.
Can I trigger both save it and then share it onto Facebook with only one button?
This is my code - which work well following Burak Kaan Köse's:
public async void GetImage()
{
StorageFolder folder = ApplicationData.Current.LocalFolder;
if (folder != null)
{
StorageFile file = await folder.CreateFileAsync("imagefile", CreationCollisionOption.ReplaceExisting);
string url = imgUri[fLFl.SelectedIndex].ToString();
HttpClient client = new HttpClient();
byte[] fileContent = await client.GetByteArrayAsync(url); ; // This is where you set your content as byteArray
Stream fileStream = await file.OpenStreamForWriteAsync();
fileStream.Write(fileContent, 0, fileContent.Length);
fileStream.Flush();
fileStream.Dispose();
}
}
Don't forget to change 'imagefile' path and fileContent variable.