Forum Discussion

wsurguy's avatar
wsurguy
Adept
10 years ago

REST API - Issue trying to upload image from C# application

Hi All,

  I am attempting to upload an image to a users Public album from a C# application and am receiving the following error.

 

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<response status="error">
<error code="100">
<message>
The file upload encountered a problem.
</message>
</error>
</response>

 

This is the target URL I am using.  I have replaced out community and session ket in the URL with dummy text.

 

http://OURCOMMUNITYNAME/restapi/vc/users/id/11/media/albums/default/public/images/upload?restapi.session_key=CURRENTSESSIONKEY.

 

I am performing a HttpWebRequest POST as a multipart/form-data content type.

 

Are there any good examples of trying this in C# or any suggestions on how to trouble shoot the error result that is returned.

 

Thank you

Wayne

  • All,
    I made some updates and now am getting a (403) Forbidden response from the stage environment when attempting the upload via the REST API. I get the same when trying to upload an attachment with a TKB entry.
    I can create a TKB entry without an attachment with no issues.
    • ChhamaJ's avatar
      ChhamaJ
      Khoros Staff

      I could not get this to working but I think I am doing something wrong in multi part form-data. AdamA or @AndrewD, I believe you guys are using this for media gallery, will you be able to help?

       

      Regards,
      Chhama