Skip to content

Conversation

@devanathan-vaithiyanathan
Copy link
Contributor

Issue Details

The FileResult constructor was being called with (filePath, fileName) but the second parameter expects a MIME type, not a filename. This caused the filename to be stored as ContentType.

Description of Change

Fixed FileResult initialization to properly preserve the filename and ContentType.

Regarding Test Case

Picking an image is not possible in a test.

Issues Fixed

Fixes #33348

Tested the behavior in the following platforms.

  • Android
  • Windows
  • iOS
  • Mac
Before After
iOS
Before.mov
iOS
After.mov

@dotnet-policy-service dotnet-policy-service bot added the partner/syncfusion Issues / PR's with Syncfusion collaboration label Jan 6, 2026
@vishnumenon2684 vishnumenon2684 added the community ✨ Community Contribution label Jan 6, 2026
@sheiksyedm sheiksyedm marked this pull request as ready for review January 6, 2026 13:24
Copilot AI review requested due to automatic review settings January 6, 2026 13:24
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a bug in the iOS MediaPicker where the FileName was incorrectly being stored in the ContentType property when creating rotated image results. The issue occurred because the FileResult constructor's second parameter expects a MIME type (contentType), but the filename was being passed instead.

Key changes:

  • Modified FileResult initialization to use object initializer syntax for setting the FileName property instead of passing it as a constructor parameter

@devanathan-vaithiyanathan devanathan-vaithiyanathan changed the title [iOS] Fix MediaPicker PickPhotosAsync getting file name in contentType property [Regression][iOS] Fix MediaPicker PickPhotosAsync getting file name in contentType property Jan 7, 2026
Copy link
Member

@jfversluis jfversluis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - Approved

This is a clean regression fix for the MediaPicker issue where FileName and ContentType were swapped.

Changes:

  • Correctly initializes FileResult with proper property assignments
  • Preserves both FileName and ContentType as suggested in review
  • All CI checks passing (23/23)

Impact:

  • Fixes regression introduced in 10.0-preview7
  • Restores correct behavior for iOS MediaPicker with RotateImage=true

Great catch and clean fix! 🚀

@jfversluis jfversluis added this to the .NET 10.0 SR3 milestone Jan 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-essentials-mediapicker community ✨ Community Contribution partner/syncfusion Issues / PR's with Syncfusion collaboration platform/ios

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[iOS] MediaPicker PickPhotosAsync getting file name in contentType property

4 participants