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

FilePicker Plugin for Xamarin and Windows
MIT License
74 stars 52 forks source link

Need example #51

Closed Specko93 closed 6 years ago

Specko93 commented 7 years ago

Can someone give me an example of FilePicker, I don't know how to call it..

procopio commented 7 years ago
var filedata = await Plugin.FilePicker.CrossFilePicker.Current.PickFile();

                var myPickedFile= new MyPickedFile
                {
                    Name = filedata.FileName,
                    Content = filedata.DataArray,
                };
nmano2188 commented 6 years ago

MyPickedFile what is that?

procopio commented 6 years ago

A simple class:

public class MyPickedFile
    {
        public string Name { get; set; }
        public byte[] Content { get; set; }
    }
nmano2188 commented 6 years ago

How do i get File path of the selected file?

procopio commented 6 years ago

I don't get the file path, just file Name and the Content. Load the Content on a Stream and use the file as you need.

jfversluis commented 6 years ago

There are samples available on the new repo on: https://github.com/jfversluis/FilePicker-Plugin-for-Xamarin-and-Windows/issues