Service Portal, File Upload, Attachments API, ng-file-upload

scottl
Kilo Sage

Does anyone know how to upload a file through the Attachment API with Angular and the module ng-file-upload. I'm having issues trying to pass the actual file data.

Doc: AttachmentAPI-POST

The record is inserted into the sys_attachment table however the file is corrupt and the Content-Type field states;

"multipart/form-data; boundary=---------------------------21049309652076611724709014224"

Even thou the headers are being set as "image/jpeg"

1 ACCEPTED SOLUTION

Bhagya Lakshmi
Mega Guru

Hi,

Please go through bellow link. It may helpful to you.

Link

 

Thanks.

View solution in original post

3 REPLIES 3

Bhagya Lakshmi
Mega Guru

Hi,

Please go through bellow link. It may helpful to you.

Link

 

Thanks.

Thanks for that. I found your "share" widget which helped.

I ended up using the basic $http request and removed the ng-file-upload module, and used FormData() like you had in your code, and it works perfectly.

Hi Bhagya,

I want to create a file upload functinality but as i am new , i don't know how to do this?

Could you please help me on this?

 

 

Regards,

Manmath