Add attachment to a list using rest

  • 5 February 2018
  • 1 reply
  • 6 views

Badge +4

Hi everyone happy.png

 

I have used this:

 

NWF$.ajax(

   { url: _spPageContextInfo.webAbsoluteUrl + "/_api/web/lists/getbytitle('test3')/items(" +    IDfrm + ")/AttachmentFiles/ add(FileName='" + fileName +    "',overwrite=false)?   $expand=ListItemAllFields",

  method: 'POST',

...

 

In oreder to add file from input,

What could be the problem?


1 reply

Userlevel 7
Badge +17

Possibly some CORS issues. Check this post:  

Regards,

Tomasz

Reply