Before you can manage attachments and images in the Service Layer, you must create a network shared folder with read and write permissions on Windows. Then configure the network shared folder as the attachment folder in General Settings in the SAP Business One, Desktop client.
Note
For Service Layer running on Linux, you need to mount the Linux attachment folder to a Windows network shared folder. Please refer to the SAP note 3003664 on how to mount attachments to a shared folder.
Attachments and images can be managed in the Service Layer using the following entities:

- Attachments2
- Pictures
- ItemImages
- EmployeeImages
These have streaming capabilities and can be used to apply the Slug mechanism.
If you look at the Service Layer metadata, you’ll see that a streaming entity has a special attribute HasStream = "true", which means that the entity type is a media entity and represents a media stream, such as a photo.
Note
You can find more information about the MIME definition on the RFC Editor website.
Attachments2 Entity

This entity is an attachment collection, which can be linked to documents. The Attachment2 entity supports file types: .pdf, .doc, .docx, .jpg, .jpeg, .png, .txt, .xls, .ppt. It can handle an attachment size up to 50 MB.
General format for uploading attachments to a collection from a remote machine:
1234567891011121314POST /b1s/v2/Attachments2 HTTP/1.1
Content-Type: multipart/form-data;boundary=<Boundary>
--<Boundary>
Content-Disposition: form-data; name="files"; filename="<file1>"
Content-Type: <content type of file1>
<file1 content>
--<Boundary>
Content-Disposition: form-data; name="files"; filename="<file2>"
Content-Type: <content type of file2>
<file2 content>
--<Boundary>--
General format for downloading attachments from a collection:
1GET /b1s/v2/Attachments2(<Attachmentid>)/$value?filename='<filenametodownload>'
Pictures

This entity allows you to upload and download images to the picture folder configured in the General Settings.
General format for uploading pictures:
12345678910POST /b1s/v2/Pictures HTTP/1.1
Content-Type: multipart/form-data;boundary=<Boundary>
--<Boundary>
Content-Disposition: form-data; name="files"; filename="<file1>"
Content-Type: <content type of file1>
<file1 content>
--<Boundary>--
General format for downloading pictures:
1GET /b1s/v2/Pictures('<Pic_name.jpg>')/$value
ItemImages

This entity allows you to manage the item image in Item master data.
General format for uploading an image to the Item master data:
123456789PATCH /b1s/v1/ItemImages(<ItemCode>)
Content-Type: multipart/form-data;boundary=<Boundary>
--<Boundary>
Content-Disposition: form-data; name="files"; filename="<file>"
Content-Type: <content type of file>
<file content>
--<Boundary>--
General format for downloading an image for the itemcode:
1GET b1s/v2/ItemImages(1)/$value
EmployeeImages

This entity allows you to manage an employee image in the Employee master data.
General format for uploading an image to the Employee master data:
123456789PATCH /b1s/v2/EmployeeImages(<EmployeeCode>)
Content-Type: multipart/form-data;boundary=<Boundary>
--<Boundary>
Content-Disposition: form-data; name="files"; filename="<file>"
Content-Type: <content type of file>
<file content>
--<Boundary>--
General format for downloading an image for the Employee:
1GET b1s/v2/ItemImages(1)/$value