Comments

  • 1-2 of 2
  • Sanjay Kumar

    Thanks everyone, I can now process attachments using Rest API, no issues so far.

    I took logic.js, info.yml from OOB input/FileAttachmentUpload widget and built my own widget from it so all validations will remain intact, once an attachment is added, I am using base64 conversion and saving them to local array and sending all attachments along with other data to controller. then firing a PHP Curl REST API to external OSvC-B to save all incident data, gets the incident ID in response and fire another call to save attachments with the returned incident ID.

    ref: http://docs.oracle.com/cloud/latest/servicecs_gs/CXSVC/c_Managing_file_attachments_aa1166814.html#aa1166814

    Cheers

    Sanjay

     

  • Sanjay Kumar

    Hi Narendra, thanks for your reply

    Actually it is happening on customer portal only from OSvC-A (OSvC-B doesn't have CP Pages)

    we have two ask pages on OSvC -A , one for tickets to OSvC-A and one for OSvC-B.

    Now, for the ask page for OSvC-B, I have a custom submit button which sends data to controller and controller can fire a call using Curl to OSvC-B and create tickets.

    problem is, I am not able to upload attachments from OSvC-A to OSvC-B using curl php because PHP is server side and cannot upload attachments from a client browser, I can use JavaScript with Rest API but again, it is preventing because of CORs issue

    I can upload attachment to local OSvC-A and then upload using curl to OSvC-B, but not sure if OSvC-A also have any local storage for such purposes.

    Any hints would be appreciated

    thank you