Announcement

Collapse
No announcement yet.

Attachment Rest API

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Attachment Rest API

    Hi all,
    I don't know if this is exactly a bug, but a strange behavior happens when uploading and downloading an attachment through REST API.
    When creating an attachment through the endpoint api/v1/attachment, if the "size" attribute is not in the Request Body, EspoCRM automatically compute the file size and save it in the size attribute of the attachment.
    The size automatically computed by EspoCRM is wrong but this not seem to affect the file download from EspoCRM web interface, it does anyway affect the download when using the REST endpoint api/v1/Attachment/file/{id}: the downloaded file is corrupted.

    To reproduce the problem:
    - create a new binary attachment (I used a word .docx file) using the API endpoint api/v1/attachment without specifying the size attribute.
    - download the just attached file by using the endpoint api/v1/Attachment/file/{id}.The file should be corrupted since the file size is wrong.

    If the file size is correctly inserted in the Request Body when creating the attachment, everything works as expected.

    Thank you.
    EspoCRM is awesome.

    Bye



  • #2
    Hi,

    What EspoCRM version? I believe it has been fixed in v6.1.4. https://github.com/espocrm/espocrm/issues/1922

    Comment


    • #3
      Hi,
      Tested on Version 6.0.3.
      sorry, didn't know it was already fixed.
      Thank you

      Comment

      Working...
      X