Hi Diego,
I really appreciate your help.Referring to your solution, I would like to explain what steps I have taken below, in order to explain the problem I am facing.
(Note : I am using Rest API with Version 0.1.0.202211181521)
- .../api/v1/models/{tablename}/{id}/attachments -> The information provided is the file name and type, there is no binary data that I can convert into a file.
- .../api/v1/models/{tablename}/{id}/attachments/{filename} -> Not Acceptable, Are there any steps or requirements that I missed?
Then I looked for another way by accessing the attachment table.
- .../api/v1/models/AD_Attachment -> I got the record, and I found binary data.
Hi Carlos,Sorry for ask again, for the latest Rest API plugin jar, is it required to use JVM v17? I'm still using JVM v11.
--
You received this message because you are subscribed to the Google Groups "iDempiere" group.
To unsubscribe from this group and stop receiving emails from it, send an email to idempiere+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/idempiere/53eb35d4-cab2-4859-aa6d-37bdc89cfba2%40gmail.com.
Hello Carlos,
I'm encountering an issue with the API endpoint /api/v1/models/AD_Attachment. Currently, when attempting to use POST or PUT methods to upload a ZIP file (encoded in base64 or as bytes), the binaryData field ends up as null.
Could you assist me in finding a solution? Ideally, I'm looking for a method to successfully send a ZIP containing all attachments either through /api/v1/models/AD_Attachment or perhaps /api/v1/models/{tableName}/{id}/attachments/zip.
Thank you for your help in advance.
I actually managed to post the attachment while taking screenshots. However, I'm still facing issues when trying to edit an already created attachment. Initially, I attempted to edit and send it using models/ad_attachments, but in the post, the binaryData in base64 converts to null. I think this might be a bug
When I attempted a PUT request, it resulted in a 500 error due to issues with editing binaryData. This is also a problem
Another method I tried was using models/table_name/id/attachments/zip. This approach allowed me to successfully post the attachment.
Unfortunately, when attempting to edit using this method, I encountered a 405 error indicating that the method is not allowed :(
While I can manage with the workaround of deleting and reposting to edit an attachment, it involves making two requests for what should ideally be a single action.
I actually managed to post the attachment while taking screenshots. However, I'm still facing issues when trying to edit an already created attachment. Initially, I attempted to edit and send it using models/ad_attachments, but in the post, the binaryData in base64 converts to null. I think this might be a bug
When I attempted a PUT request, it resulted in a 500 error due to issues with editing binaryData. This is also a problem
Another method I tried was using models/table_name/id/attachments/zip. This approach allowed me to successfully post the attachment.
Unfortunately, when attempting to edit using this method, I encountered a 405 error indicating that the method is not allowed :(