title: How to save a BitmapImage to StorageFolder in C# Windows Phone 8
body: <p>I'm trying to save a BitmapImage, which I download from a url, in to the app StorageFolder.
  I tryed to make a function which saves te image for me. This is what I got so far:</p>
  
  <pre><code>public async Task&lt;string&gt; savePhotoLocal(BitmapImage photo, string photoName)
      {
          var profilePictures = await storageRoot.CreateFolderAsync("profilePictures", CreationCollisionOption.OpenIfExists);
          var profilePicture = await profilePictures.CreateFileAsync(photoName+".jpg", CreationCollisionOption.ReplaceExisting);
  
          byte[] byteArray = new byte[0];
          using (MemoryStream stream = new MemoryStream())
          {
              using (Stream outputStream = await profilePicture.OpenStreamForWriteAsync())
              {
                  await stream.CopyToAsync(outputStream);
              }
          }
  
          return profilePicture.Path;
      }
  </code></pre>
  
  <p>But this isn't working and I don't get any errors back, so i realy don't know whats going wrong here. Any help or code samples would be awesom.</p>