Need More Info
Last Updated: 19 Jun 2023 13:03 by ADMIN
Vishal
Created on: 04 Feb 2022 18:10
Category: UI for .NET MAUI
Type: Feature Request
5
Upload images/file via in .Net Maui
Take picture via camera and quickly upload pic.
2 comments
ADMIN
Didi
Posted on: 19 Jun 2023 13:03

Hello,

I have changed the status to Need More Info. Could you please specify what is the exact requirement for this item. Do you need a control/API, for this. I am asking as this feature request is a bit incomplete. There is no clear explanation of what is expected of this feature.

Regards,
Didi
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

ADMIN
Lance | Senior Manager Technical Support
Posted on: 04 Feb 2022 18:54

Hi Vishal,

Thank you for posting a Feature Request, however this is a bit incomplete as you've not explained what you're looking for. Where do you expect such an image to get uploaded to?

Existing Options

Camera/Media

You can currently take a photo using the existing APIs that come from Xamarin.Essentials (which will come with MAUI Essentials or built into the MAUI framework itself). Xamarin.Essentials: Media Picker - Xamarin | Microsoft Docs

Uploading

As far as uploading goes, this is very specific to the type of place you want to upload to. There are literally thousands of different APIs that all have their own way of authenticating the HTTP Post message.

In the implest form, you can use HttpClient to post that image to your API

byte[] myImageBytes = FromCameraOrMediaLibrary();
var myServerUrl = "https://myserver.com/api/pictureUpload";
var httpContent = new ByteArrayContent(myImageBytes, 0, myImageBytes.Length);

using (var client = new HttpClient())
using (var response = await client.PostAsync(myServerUrl, httpContent))
{
    if (response.IsSuccessStatusCode)
    {
        // yay uploaded!
    }
}

Summary

Ultimately, we try to go to great lengths to keep the UI components as agnostic as possible. This prevents you from getting stuck using specific API endpoints or data layer systems.

If we didn't do this, then you would be limited to a very small sliver of the possible options. This allows anyone to use the UI components with any "APIs or data system they want to.

Side Note: Additionally problematic, is there are authentication concerns as well. even if we chose to support one or two authentication systems, it would eliminate all the other options. You're much better off using HttpClient and the flexibility that comes with it.

 

Regards,
Lance | Manager Technical Support
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.