cancel
Showing results for 
Search instead for 
Did you mean: 

Attachment Service - Download attachment issue

xyla
Participant

Hi everyone!

I'm facing an issue with the Attachment Service (https://help.sap.com/viewer/4c3d1c6b3d744f84aab4c273f979f430/1909.000/en-US/b821e557b83a1070e10000000a44147b.html).

I integrated the Attachment Service reuse component into a freestyle UI5 application and everything worked just fine, but after a few days, when I was presenting it to the customer, the download attachment function wasn't working anymore (other functionality still works, ex. upload). When I click on an attachment (which should start the download), I only get a new blank tab in the browser.

The console shows following error:

If I set a breakpoint there, I can see that the URL to which the redirect is being made is empty string (but why?). The batch request that reads the attachments contains the URLs to the data and the data stream ($value), and the application also shows the data about the existing attachments.

"media_src": "https://<host:port>/sap/opu/odata/sap/CV_ATTACHMENT_SRV/OriginalContentSet(Documenttype='GOS',Documentnumber='EXT47000000000360',Documentpart='',Documentversion='',ApplicationId='005056BB1F371EECAC805FA0031E76C6',FileId='005056BB1F371EECAC805FA0031E96C6')/$value"

If I try opening the URL directly (data or data stream) the request fails.

What I already analyzed and excluded:

  • no relevant code change in the freestyle UI5 app
  • no change in the backend customizing/implementation
  • no system upgrade (what could have changed the reuse component itself)
  • browser issue (tried with Chrome and Edge, both deliver the same result)

I'm having a hard time understanding what happened and running out of ideas how to try to fix the issue. Any ideas would be appreciated!

bhanuk414
Member
0 Kudos

Hi sjooszilamer ,

Can you post the complete error message. Also, is this issue happening for single file or all the files from the attachment tab. Also, mention your S/4 version.

Regards, Bhanu

View Entire Topic
xyla
Participant

So...turns out it was a combination of some (still no idea what exactly) system configurations and a stupid error on my side.

As I wrote in my comments earlier, the download over the direct link started to work after a few days again, but the download from the UI still didn't work. That second part was my fault.

I wanted to disable the functionality to add links as attachments in the UI, but also disabled the download functionality (facepalm)...

Setting the ENABLELINK to true solved the problem.

What is confusing is that this setting didn't disable the link itself...it still was clickable. It just didn't work. Maybe SAP will improve that and disable the filename as link with setting.

kammaje_cis
Active Contributor
0 Kudos

thanks, you same me few hours