cancel
Showing results for 
Search instead for 
Did you mean: 

SAP CAP Fiori Elements upload / download image

naveenvishal
Contributor
0 Kudos

Hi,

I have created a CAP application with Fiori Elements and in the same process, I want to include field(s) in entity for image upload in edit mode and download/view in display mode.

Please suggest the image handling (upload/download) in Fiori Elements.

View Entire Topic
MioYasutake
Active Contributor
0 Kudos

@naveenvishal 

How about using the Attachment plugin? (Please note that it is currently a beta feature)

https://cap.cloud.sap/docs/plugins/#attachments

naveenvishal
Contributor
0 Kudos

Hi @MioYasutake ,

Thanks for the reply.

When I use the Attachments, the Project model goes into hang situation.

naveenvishal_0-1715775723435.png

Actually I am also using projman-service-ui.cds  (as the ui for the cds along with projman-service.cds and projman-service.js) which I think causing somehow conflict in the output.

Please suggest. 

MioYasutake
Active Contributor
0 Kudos

@naveenvishal

It looks like the latest UI5 versions (1.124.0 and 1.123.0) have an issue. If you change the version to 1.122.0, the object page loads successfully.

MioYasutake_0-1715893519769.png

index.html

 

 

 

src="https://sapui5.hana.ondemand.com/1.122.0/resources/sap-ui-core.js"

 

 

To use SAP HANA Cloud for storing attachments, add the following setting to package.json.

 

 

    "cds": {
        "requires": {
            ...,
            "attachments": {
                "kind": "db"
            }             
        }
    }

 

 

My Git repo for reference: https://github.com/miyasuta/cap-attachment

 

naveenvishal
Contributor
0 Kudos

Hi Mio, I am getting error while testing in hybrid mode. Also when I deploy the solution to Production, I am getting errors (attached log file in link below). Please check this - https://github.com/cap-js/attachments/issues/50

MioYasutake
Active Contributor
0 Kudos
@naveenvishal I tried executing in hybrid mode and didn't have any issue. Have you added the package.json config I mentioned above?
naveenvishal
Contributor
0 Kudos
Hi Mio, This works fine as you suggested. Thaks for the guidance !