Skip to main content
Solved

OData upload attachment "Error occurred while reading binary data"


Forum|alt.badge.img+4

trying to add an attachment via OData in a test environment with FSM6u6. I have encoded the binary file with base64 but I cannot seem to upload the file

URL - http://fsmURL//odata/attachment

parameter - 

{
   "attachment@odata.mediaEditLink":"encoded the binary file with base64",
   "attachment_name":"testtwo.jpg",
   "file_type":"image/jpeg"

}

refer the attach image for the output.

is it possible to attach encoded the binary file with base64 in FSM using the above mentioned API?

 

Best answer by Jon Reid

See “WORKING WITH ATTACHMENTS AND IMAGES” starting on page 30 of the FSM6 OData REST APIs document (Help->Documentation->Integrations->FSM6 OData REST APIs.   Especially keep in mind “Note that the file/url must be accessible to the FSM server” as mentioned on page 32.

View original
Did this topic help you find an answer to your question?

Forum|alt.badge.img+4

Tagging #IFSACH #ACHTECH
CC: @Yasas Kasthuriarachchi


Yasas Kasthuriarachchi
Superhero (Employee)
Forum|alt.badge.img+30

HI @Lee Pinchbeck could you please check on the above since it relates to FSM.
Thanks & Best Regards,
Yasas


Lee Pinchbeck
Ultimate Hero
Forum|alt.badge.img+24

Hi @Kajendran Chandreswaran,

I have not seen base64 given as an accepted format but I have passed this to R&D for them to give a definitive answer on this.

Kind regards,

Lee Pinchbeck


Jon Reid
Hero (Employee)
Forum|alt.badge.img+18
  • Hero (Employee)
  • July 7, 2021

See “WORKING WITH ATTACHMENTS AND IMAGES” starting on page 30 of the FSM6 OData REST APIs document (Help->Documentation->Integrations->FSM6 OData REST APIs.   Especially keep in mind “Note that the file/url must be accessible to the FSM server” as mentioned on page 32.


Forum|alt.badge.img+3
  • Do Gooder (Employee)
  • July 8, 2021

To upload binary data through OData service, we need to save the file in a location where OData service has access to read the file.

 

URL specified in attachment@odata.mediaEditLink should be accessible from the OData service.

 

E.g.

As a file URL.

POST http://<servername>/<fsmserver>/odata/attachment

{
"attachment@odata.mediaEditLink": "file://mkepde64/M5Attachments/626175160.jpg",
"attachment_id": 1209,
"attachment_name": "uploaded through odata",
"file_type": "image/jpeg"
}

 

As a URL.

POST http://<servername>/<fsmserver>/odata/attachment

{

"attachment@odata.mediaEditLink": "https://fsmdev64-rnd.ifsworld.com/uploads/dell_install_guide.pdf",

"attachment_name": "Attachment created through OData",

"file_type": "application/pdf"

}

 

When creating an attachment with an OData service hosted in Azure, we can use a fileshare created in the storage account associated with FSM server.

 

POST https://fsm6qa.fsm.ifsdevworld.com/odata/attachment

Body
{
"attachment@odata.mediaEditLink": "fsmshare/inbound/exceptions/000freezer.jpg",
"attachment_name": "FSMZ-2916 OData upload",
"file_type": "image/jpeg"
}


Forum|alt.badge.img+4

thank you for the information @sachinthaw and @Jon Reid

 

so is it possible to upload the attachment in base 64 format?

is there any acceptable encryption format that can be used for uploading attachment?


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings