How save image into DCIM/Camera folder??

LuanFauthLuanFauth BRMember
edited November 2014 in Xamarin.Android

Hello Xamarins!!

I need save a downloaded image into Camera roll folder, or other anyway name folder into DCIM path, but... nothing happen!!

I use this code:

var webClient = new WebClient();
byte[] arrey = await webClient.DownloadDataTaskAsync("http://bestcars.uol.com.br/bc/wp-content/uploads/2013/02/Chevrolet-Corvette-Stingray-03.jpg");

string AcessoPath = Android.OS.Environment.GetExternalStoragePublicDirectory(Android.OS.Environment.DirectoryDcim).AbsolutePath;
var filename = Path.Combine(AcessoPath, "Camera/photo.png");
try
{
        File.WriteAllBytes(filename, arrey);
}
catch (Exception ex)
{
        Console.WriteLine(ex.Message);
}

On debugging, nothing happen. NOTHING!!!
Don't enter into catch, and don't appear any wrong or error message into output.

Exist anyone other way to save image (bitmap/byte[]) into DCIM directory?

Sign In or Register to comment.