jfversluis / FilePicker-Plugin-for-Xamarin-and-Windows

FilePicker Plugin for Xamarin and Windows
MIT License
157 stars 80 forks source link

Is there way to save the chosen file to a device path #206

Closed jpolocosme closed 4 years ago

jpolocosme commented 4 years ago

Thanks for creating this nugget, is there way to save the chosen file to a device path

jpolocosme commented 4 years ago

what happens is that, I need to choose a .p12 file and save it in some path, so it is not only to see its content and copy it to another file to replace this, but to choose it and save that same one.

jpolocosme commented 4 years ago

after many attempts this served me:

string objrute = Path.Combine(rute.path_cert, fileData.FileName); File.WriteAllBytes(objruta, fileData.DataArray);

vividos commented 4 years ago

That's the way. You can also use result.GetStream() and use Stream.CopyTo(), if you want to go async.

jpolocosme commented 4 years ago

Gracias, saludos.

vividos commented 4 years ago

You're welcome. By the way, it's actually Stream.CopyToAsync(), and there you can also specify a CancellationToken, e.g. for a progress dialog where the user can cancel the copying.