2024 May 15 3:56 PM - edited 2024 May 15 3:58 PM
Dear Experts,
When I upload a jpeg file to a remote server via Service Layer, the file is created in temp folder and in the SAP attachment folder. Also a new entry is created in the ATC1 table.
However, the upoaded file is empty and cannot be opened.
File size on my local PC (before the upload) is: 3166 bytes
File size on SAP attachment folder (after the upload) is: 796 bytes
If I try to open it with paint, I have this error:
Error message "Paint cannot read this file. This is not a valid bitmap file, or its format is not currently supported"
If I open it with Notepad, I see this text content:
<binary data>
Service Layer temp folder (located on the server where the Service Layer runs):
C:\Windows\Temp\ServiceLayer\Attachments2
I use Postman:
POST Request:
https://[RemoteServerAndPort]/b1s/v1/Attachments2
Request Header:
Content-Type: multipart/form-data; boundary=WebKitFormBoundaryUmZoXOtOBNCTLyxT
Request Body (type text):
--WebKitFormBoundaryUmZoXOtOBNCTLyxT
Content-Disposition: form-data; name="files"; filename="line8.jpeg"
Content-Type: image/jpeg
<binary data>
--WebKitFormBoundaryUmZoXOtOBNCTLyxT--
Response body:
{
"odata.metadata": "https://[RemoteServerAndPort]/b1s/v1/$metadata#Attachments2/@Element",
"AbsoluteEntry": 2196,
"Attachments2_Lines": [
{
"AbsoluteEntry": 2196,
"LineNum": 1,
"SourcePath": "C:\\Windows\\TEMP\\ServiceLayer\\Attachments2/",
"FileName": "line8",
"FileExtension": "jpeg",
"AttachmentDate": "2024-05-15T00:00:00Z",
"Override": "tNO",
"FreeText": null,
"CopyToTargetDoc": "tNO",
"CopyToProductionOrder": "tNO"
}
]
}
How can I upload a jpeg file using Service Layer please?
Thank you!
Claudio
Request clarification before answering.
Any help please?
Thank you
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Ankit,
The version is:
SAP B1 10.0 (10.00.191) FP 2202 - SQL version
Thanks, Kind Regards,
Claudio
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
95 | |
11 | |
10 | |
10 | |
6 | |
6 | |
4 | |
4 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.