Skip to Content

How to specify the media types in FUIAttachmentsFormCell?

Hi

I am using FUIAttachmentsFormCell in my projects in many modules. I have to upload only images to the backend. so I have to restrict selecting videos from iOS photo library. This is possible in iOS UIImagePickerController API. We can control the camera mode.

let imagePickerController = UIImagePickerController()
imagePickerController.mediaTypes = [kUTTypeImage, kUTTypeGIF, kUTTypeBMP] as [String]        imagePickerController.cameraDevice = .rear

How to do set the attributes FUIAttachmentFormCell?

SDK Used: v3.2.7

Add a comment
10|10000 characters needed characters exceeded

Related questions

3 Answers

  • Posted on Oct 15, 2019 at 02:01 PM

    Hi, I did not try the attachment API yet, but it looks like you can filter out,

    check the FUIDocumentPickerAttachmentAction

    and it's delegate FUIDocumentPickerAttachmentActionDelegate

    https://help.sap.com/doc/978e4f6c968c4cc5a30f9d324aa4b1d7/3.0/en-US/Documents/Frameworks/SAPFiori/Classes/FUIDocumentPickerAttachmentAction.html#/s:8SAPFiori33FUIDocumentPickerAttachmentActionC8delegateAA0bcdE8Delegate_pSgXwvp

    you can return an instance of UIDocumentPickerViewController, take the init where you can supply an array of document types

    https://developer.apple.com/documentation/uikit/uidocumentpickerviewcontroller

    alex

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Nov 07, 2019 at 06:22 PM

    @Mahabaleshwar Hegde checking with the developer.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Nov 07, 2019 at 09:30 PM

    In SAPFiori 4.0 release, there is a new property in the FUIAddPhotoAttachmentAction which allows developers to choose the media types to be used:

    /**

    The types of media that are allowed.

    Use this property to customize the media types allowed for this attachment action.

    If this is not specified, the default is:

    ``` swift

    [kUTTypeMovie as String, kUTTypeImage as String]

    ```

    This means both video and photo are allowed to be chosen.

    Constants `kUTTypeMovie` and `kUTTypeImage` are defined in `MobileCoreServices`.

    */

    public var mediaTypes: [String]?

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.