cancel
Showing results for 
Search instead for 
Did you mean: 

SAPB1 SL Attachments2 endpoint "File with that name already exists"

FLSAP
Explorer
0 Kudos

Hi there,

So I am trying on two differenty installations of SAPB1 to upload a file using the service layer /Attachments2 endpoint.

I keep getting "A file with that name already exists" even though I am sure it doesnt.
It does not matter if I create a completely new file and even give it a GUID as filename, it keeps throwing me this exact message.

"code": -10

"value": "A file with this name already exists. [Attachments2_Lines.FileName][line: 1] , '\\\\SAPSERVER01\\b1\\Documents\\e5eed141-882d-468b-b389-f3f24d2100ee.pdf'"

By chance anyone has any idea as of why?

Best regards

Accepted Solutions (0)

Answers (2)

Answers (2)

FLSAP
Explorer
0 Kudos

I have figured out it's rights to the share and has nothing to do with the filename.

If I give "Everyone" rights to the windows share I can easily upload files through the /attachments2 endpoint.

My question now is, which user needs access to the share in order for the service layer to be able to upload files to the /attachments2 endpoint? Service layer (windows server) is running with "Local system" as an account.

How can I upload files to /attachments2 without putting "Everyone" on the share?

Best regards

ANKIT_CHAUHAN
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi shamatix,

This behaviour appears to be caused by the enhancements to attachment functionality as of SAP Business One Version 10.0 FP 2111.

Kindly refer to SAP Note 3114688 for the same.

Select the option Do Not Overwrite Attachments with the Same File Name under Administration → System Initialization → Document Settings → General as per your requirement and test the issue again.

Kind regards,

ANKIT CHAUHAN

SAP Business One Support