Use .NET MAUI FilePicker to Pick PDFs, Images, Videos and More!

Поделиться
HTML-код
  • Опубликовано: 11 сен 2024

Комментарии • 106

  • @jfversluis
    @jfversluis  Год назад +4

    What else you can do with .NET MAUI? The sky is the limit! Check out this playlist right here with videos about plugins from the community to make your life easier! ruclips.net/video/nCNh9G-Q688/видео.html

  • @billrichards7838
    @billrichards7838 Год назад

    Gerald -- Just want to say all of your videos since day 1 on MAUI have be EXCEPTIONAL!!! They are all well articulated and are extremely helpful in adoption of the MAUI platform. Your personality with the humor and quirky editing styles added to the videos also make them very entertaining!!! -- your content is greatly Appreciated!!!

    • @jfversluis
      @jfversluis  Год назад

      Don’t know how I missed this comment, so sorry. I’m glad I stumbled on it now because it made my day! Thank you 🥰

  • @andreasschramm6521
    @andreasschramm6521 Год назад +4

    Thank you for this Video! But it is possible that you can access a file without the FilePicker (filepath?) For example on a local NAS drive.

  • @THE_NE0
    @THE_NE0 Год назад +5

    Very very useful, Thank you for the amazing content! can you cover drag and drop in MAUI ?

    • @jfversluis
      @jfversluis  Год назад +3

      Great suggestion! Will look into it, thanks!

    • @user-fe9np3pi3t
      @user-fe9np3pi3t Год назад

      @@jfversluis Hey @Gerald, were you able to implement the drag and drop by any chance?

  • @RobDaytona
    @RobDaytona 4 месяца назад

    Cool, now I have a way for players to upload their own character profile pics 😊

  • @Mielesplayz
    @Mielesplayz Год назад +1

    Thanks for the tutorial!

  • @ayisthiya740
    @ayisthiya740 3 месяца назад

    Your video so good for learning keep doing,
    I have to ask you something, it's possible to show textfile of datas into combobox if its yes please tell me how to do that

  • @hamdymorsy2023
    @hamdymorsy2023 Год назад

    Thanks Gerald , please continue with this great videos .

  • @deanbergey3594
    @deanbergey3594 Год назад

    Ha mate, thanks so much for doing this video and explaining everything so clearly, appreciated

    • @jfversluis
      @jfversluis  Год назад

      You’re most welcome my friend!

  • @MuhammadNadeem-wj6xd
    @MuhammadNadeem-wj6xd Год назад

    Very nice @Gerald keep it up its really appreciated. Thanks again for the video

    • @jfversluis
      @jfversluis  Год назад

      Thank you, definitely will! 20k soon 🚀

  • @Ookani99
    @Ookani99 Год назад +1

    I try to use binding in the image using mvvm and not work

  • @gianfrancomendez9440
    @gianfrancomendez9440 Год назад

    Keep it up!!!, do something with a bluetooth connection! could be nice for IoT projects !

  • @earthlingthings
    @earthlingthings Месяц назад

    Can i let user pick an image from resources/images folder?

  • @lebeluet
    @lebeluet Год назад

    Thanks for this introduction video. Can we tell the FilePicker dialog to point to the App data local Storage before the dialog shows.

  • @IngmarCrone
    @IngmarCrone 7 месяцев назад

    Hi @jfversluis, is there a way to have a shared blazor component containing a FilePicker for Maui, but not for the Blazor Website? Now I think about it, this could mabey be done with the factory pattern?

  • @hansjorgbieler4219
    @hansjorgbieler4219 8 месяцев назад

    Thanks for that video - I realy enjoy watching your videos! Allthough - for some reason the code from the repo does not compile anymore (just want to mention to you ;-) In a new maui app project I can get the code sniplets to work, but the pics don't show up (tried on windows and android with VS2022 and vs2022Preview) Maybe you can look into this problem... ;-)
    Again: thanks for your videos

  • @lanyon2000
    @lanyon2000 Год назад

    Thank you man for sharing this stuff

  • @BreakingSkiesMedia
    @BreakingSkiesMedia Год назад

    Hello, I am trying for while to pick an image with my ios simulator. I am going through the docs and I can pick an image but when I write the stream to the source, nothing is happening. The old source remains, or no source is updated: FileResult photo = await MediaPicker.Default.PickPhotoAsync();
    using Stream sourceStream = await photo.OpenReadAsync();
    img_profilePic.Source = ImageSource.FromStream(() => sourceStream);
    is my code wrong?

  • @hesham1871
    @hesham1871 Год назад

    thank you , you learn me a lot of things, thanks very mush

  • @apaquette
    @apaquette Год назад

    I'm trying to do this but with MAUI Blazor and razor pages. The main issue I'm running into is displaying an image the user has selected. I'm trying to assign the file path to the source of the image ("src" in this case), but it never successfully displays an image. I am using "CapturePhotoAsyc", and the documentation does say to use "OpenReadAsync" instead of "FullPath", but it doesn't show any examples of displaying pictures. Because I'm not using XAML, I'm not able to do it like in the video because I can't assign an ImageSource to an img tag. At this point, I need to somehow get a valid directory from the photo the user selects and I'm not sure how to do that using "OpenReadAsync" as the documentation suggests.

  • @ridingbeats
    @ridingbeats Год назад

    THANK YOU MY BROTHER FROM ANOTHER COUNTRY AND ANOTHER FAMILY!!!

  • @manadochannel6025
    @manadochannel6025 6 месяцев назад

    in windows when deployed with MSBuild is not working

  • @jallenRL
    @jallenRL 6 месяцев назад

    Thanks for all your videos! Is there any way to pick multiple images on iOs using FilePicker or MediaPicker?

    • @jfversluis
      @jfversluis  6 месяцев назад

      For FilePicker you can use PickMultipleFilesAsync: learn.microsoft.com/dotnet/maui/platform-integration/storage/file-picker?view=net-maui-8.0&tabs=android#pick-multiple-files
      For MediaPicker unfortunately not possible, you’ll have to use another plugin for that or write your own

    • @jallenRL
      @jallenRL 6 месяцев назад

      Got it, thank you @@jfversluis

  • @ApeOfGrape
    @ApeOfGrape 10 месяцев назад

    It appears on MacCatalyst, 'await' is being ignored with the FilePicker. 'await' worked fine with the DisplayAlert dialog but if I put a debug.print statement right after the FilePicker, it prints the output message while the picker is still open. As a consequence, the result is always null. Anyone found a way around this?

  • @WinTerzZ2232
    @WinTerzZ2232 22 дня назад

    Hello Sir! Is there currently a way to implement an initial directory for the FilePicker like in Windows Forms?

    • @jfversluis
      @jfversluis  22 дня назад

      You can with the FolderPicker in .NET MAUI Community Toolkit, I don't think with FilePicker right now unfortunately

  • @arnoldialessandro
    @arnoldialessandro Год назад

    If i launch this example for picking image on Android 7 i get this error : Android.Content.Res.Resources+NotFoundException: 'Resource ID #0x7f0d0003' .Why???

  • @garawaa5411
    @garawaa5411 Год назад +1

    Has Maui file save picker?

    • @jfversluis
      @jfversluis  Год назад

      Being worked on in the .NET MAUI Community Toolkit

  • @hesham1871
    @hesham1871 Год назад

    Please make a video to know how we can upload a file to onedrive using maui the old ways don't work

  • @r.gopalakrishnan6926
    @r.gopalakrishnan6926 Год назад

    Superb👌

  • @user-nv4sh1ie7m
    @user-nv4sh1ie7m Год назад

    so i am running this on android emulator and it works but there are no files on emulator to pick and there is no way to go back to app. Am I missing something?

    • @jfversluis
      @jfversluis  Год назад

      On Android there is always the back button! You can drag files from your desktop on to the Android emulator to add them there.

  • @yaKaiZen
    @yaKaiZen Год назад

    Thanks for this amazing video! What option do we have to invoke the camera to capture a profile image for the user registration/ profile update page?

    • @jfversluis
      @jfversluis  Год назад +2

      You'll want to use MediaPicker for that. This is for Xamarin, but should work the same for .NET MAUI: ruclips.net/video/AYfGxhEHiec/видео.html

  • @prashanthvarma9355
    @prashanthvarma9355 Год назад

    This is what i was looking for. You save my time. Also do you know how convert image to grayscale in maui?

    • @jfversluis
      @jfversluis  Год назад

      Perfect! Glad I was able to help! Probably look at Microsoft.MAUI.Graphics or SkiaSharp

    • @prashanthvarma9355
      @prashanthvarma9355 Год назад

      @@jfversluis Thanks. will look into them

  • @rakhirevdekar4719
    @rakhirevdekar4719 Год назад

    Thank you sir

  • @ayadav-b4h
    @ayadav-b4h Год назад

    Hi, I have implemented this and it's working fine on Android and Windows. However, on iOS, I am unable to pick images from the gallery. It only shows the file pick option. Is there any way I can access iPhone gallery images?

    • @arnoldialessandro
      @arnoldialessandro Год назад

      If i launch this example for picking image on Android 7 i get this error : Android.Content.Res.Resources+NotFoundException: 'Resource ID #0x7f0d0003' .Why???

  • @ajaymundi1151
    @ajaymundi1151 Год назад

    Hey Gerald, great video as always :). What if I want to open a pdf I already have stored locally without filepicker ?

    • @jfversluis
      @jfversluis  Год назад

      Thanks! Then you probably want to use the Launcher: learn.microsoft.com/xamarin/essentials/launcher?tabs=ios

    • @ajaymundi1151
      @ajaymundi1151 Год назад

      @@jfversluis Thanks worked like a charm!

  • @alessandrocaliaro3418
    @alessandrocaliaro3418 Год назад

    ciao
    Gerald.
    I am using the FilePicker. It works fine on Android. I don't understand something on IPad. When I open the FilePicker it visualize the" File" picker (as when I open the "File" app). But I am not able to select photos. Is possible to select photos from the "Photo" app?

  • @MarekLS60
    @MarekLS60 7 дней назад

    How to access photos on SMB: volume (mounted drive) on Android phone ?

    • @jfversluis
      @jfversluis  6 дней назад

      You’ll probably have to implement the Samba protocol yourself

  • @ricardoalejandroescalantem8217

    Dear Gerald.
    Excellent video, but I'm trying to open a type of file with a .key extension, in the options I put:
    { DevicePlatform.Android, new[] { "application/key" } }
    But the dialog box that opens leaves all files disabled, even the .key file.
    What am I doing wrong ?

    • @jfversluis
      @jfversluis  Год назад

      According to this the mime type for a key file is application/pkcs8 pki-tutorial.readthedocs.io/en/latest/mime.html

    • @ricardoalejandroescalantem8217
      @ricardoalejandroescalantem8217 Год назад

      @@jfversluis It was the same, all the files are disabled, but you gave me a way to continue trying to solve my problem.
      Thank you very much for your time and response.
      Greetings from Leon Gto México

    • @AlesterPortable
      @AlesterPortable Год назад

      @@ricardoalejandroescalantem8217 Just had a similar issue with audio files. You may want to check out android.googlesource.com/platform/external/mime-support/+/9817b71a54a2ee8b691c1dfa937c0f9b16b3473c/mime.types

  • @TacticalAllianceGamingYT
    @TacticalAllianceGamingYT Год назад

    I can't seem to get a custom file extension to display. It appears that when i create the sqlite3 database it's not adding the extension.

  • @ericcgaxiola1785
    @ericcgaxiola1785 Год назад

    ¡Gracias!

  • @patrickkristianto9807
    @patrickkristianto9807 Год назад

    Hello, Is it possible to select the "All Type Files"?

    • @jfversluis
      @jfversluis  Год назад

      I would think that happens if you don’t specify any file types

  • @leonlee3186
    @leonlee3186 Год назад

    Thanks for this amazing video. But how to use .net maui MediaPicker add method to select multiple images and CapturePhotosAsync to take multiple photos ? Can anyone help me please.

    • @jfversluis
      @jfversluis  Год назад

      You probably want to have a look at the MediaGallery plugin, I think that can do it

  • @madraven37
    @madraven37 Год назад

    Is there an option on this API to limit how many images to pick in multiple option??

    • @jfversluis
      @jfversluis  Год назад +1

      I don't think we have that right now

    • @madraven37
      @madraven37 Год назад

      @@jfversluis Thank you for the response, do you think we have an option that would downsize the image? I'm uploading the image on a Firebase Firestore and downloading it will take 30 to 40 seconds to load on my app, depending on the size of the image. Do you have any suggestions for this to be fixed? I don't want my users to wait for 30 to 40 seconds just for the page to load their images.

  • @Wayne_Mather
    @Wayne_Mather Год назад

    What about using a file that's on a normal one drive folder? Picker does not work for me

    • @jfversluis
      @jfversluis  Год назад

      I guess that's because the file is not actually on the drive. It's only a reference and is downloaded as requested which is maybe not triggered be the fact that the file picker picks it. Not sure, just thinking out loud :)

    • @Wayne_Mather
      @Wayne_Mather Год назад

      @@jfversluis Yes, and you end up with a file created in the directory of the application (just a guess - device not rooted) But other applications are able to do it so I don't understand... For context, wanted a sqlite database synchronized via onedrive (was going to try dropbox as well, but suspect maybe same problem)

    • @jfversluis
      @jfversluis  Год назад

      @@Wayne_Mather sure there is probably something to make it work, but I don’t know how without looking into it, sorry!

    • @Wayne_Mather
      @Wayne_Mather Год назад

      @@jfversluis hmm, sounds like a perfect candidate for a video! Maybe even how to debug the MAUI code base to understand just whats happening? As it maybe an issue with how onedrive responds to the request and the picker API handling that response

  • @lcppb
    @lcppb Год назад

    Ola, com injecao de dependencia...

    • @jfversluis
      @jfversluis  Год назад

      All of these APIs can be used with dependency injection

  • @muhammadibrahim-ye3hs
    @muhammadibrahim-ye3hs Год назад

    can you please make a video on capture images using camera on windows mine is not working thanks

    • @jfversluis
      @jfversluis  Год назад

      Check my latest video, that might help! ruclips.net/video/nlZSLPf22vI/видео.html

    • @muhammadibrahim-ye3hs
      @muhammadibrahim-ye3hs Год назад

      @@jfversluis Thank you so much :)

  • @kyreehenry9202
    @kyreehenry9202 Год назад

    The file picker causes the app to crash if no file is selected

    • @jfversluis
      @jfversluis  Год назад

      File picker returns null of no file is chosen. This is documented and as per design.

  • @GuildOfCalamity
    @GuildOfCalamity Год назад

    On Windows, the FilePicker.PickAsync gives me a "System.ArgumentException: Value does not fall within the expected range." ?

    • @jfversluis
      @jfversluis  Год назад

      Hm not sure, sorry! If you believe there is a bug check if there is an issue on the repo for it

  • @slightlyaveragegamingindiv3577

    255 likes, perfect octet

  • @DavidLardy
    @DavidLardy Год назад +1

    Merci !

    • @jfversluis
      @jfversluis  Год назад +1

      Oh no you merci David! Thank you so much for the support 🙏

  • @Mielesplayz
    @Mielesplayz Год назад +1

    13:30 for some reason this doesn't seem to work with Gifs on Android.
    My code:
    var costumFileType =
    new FilePickerFileType(new Dictionary
    {
    {DevicePlatform.iOS, new[] {"com.adobe.gif"} },
    {DevicePlatform.Android, new[] { "application/gif" } },
    {DevicePlatform.WinUI, new[] {".gif"} }
    });

    • @jfversluis
      @jfversluis  Год назад

      You can't just replace the extension in the mime type or the UTType for iOS. The right mime type for a gif is image/gif

    • @Mielesplayz
      @Mielesplayz Год назад

      @@jfversluis thanks, I don't know why I didn't think of that 😅

  • @amasoumi
    @amasoumi Год назад

    Hi Gerald,
    another great video from you, you the man!!
    i was wondering if i could actually produce a Base64 string from the stream, i mean i did it and it works on Android emulator , but when i actually publish it then upon saving it gives me "Unexpected character encountered while parsing value: new MemoryStream(bytes));
    imageBase64 = System.Convert.ToBase64String(bytes);
    }
    }

    • @jfversluis
      @jfversluis  Год назад

      "Unexpected character encountered while parsing value:

    • @amasoumi
      @amasoumi Год назад

      @@jfversluis that is 100% true, but I am puzzled as to why exact same code works on emulators and web version of this app, but not when I publish it to device, I am wondering if the device itself adds something to it,🤔🤔🤔
      Thanks for the quick reply though 🙏🙏

    • @jfversluis
      @jfversluis  Год назад +1

      Try to find what is different. There has to be something. Try to recreate the request with something like postman. Or debug through it and inspect what the response is that is coming back.

    • @amasoumi
      @amasoumi Год назад

      @@jfversluis the issue was the size and format of the file being uploaded from devices itself, when I edit the file and make it smaller then everything works,
      Thanks!!