Forum Discussion

jcsajtai's avatar
jcsajtai
Contributor
9 years ago

Embedded pictures dont work in post

Dear Helpdesk,

 

In the Lithium Forum integration for Vodafone Germany we have a problem when we want to send a post reply from our system with an embedded picture.

 

Today at 11:24:35 I tried to send a post with embedded picture "sun_blade_1000_h400px.jpg" and I've got following error back: "Upload result status code: 403... Access to the specified resource has been forbidden." (URL called:

https://forum-stage.vfd2-testnet.de/restapi/vcusers/login/Hanni_Marteau/media/albums/default/public/images/upload)

 

 

Please check in the logs from your side, what is the root cause of the issue exactly.

 

Here is log snippet from our side:

 

2016-07-28T11:24:35.534 Dbg 42256 |U| (channel-lithium).(driver).(uploadImageRequest): Assembling comment part: https://forum-stage.vfd2-testnet.de/restapi/vcusers/login/Hanni_Marteau/media/albums/default/public/images/upload?restapi.session_key=JQthWcGhLNtc3B_5_nmkT06htowOQOgvJv0ssvZ8_DI.&credentials.user=%2Fusers%2Flogin%2FHanni_Marteau&restapi.response_format=json
2016-07-28T11:24:35.546 Dbg 42256 |U| (channel-lithium).(driver).(uploadImageRequest): Processing file: 0006YaBPQA0G045C
2016-07-28T11:24:35.738 Dbg 42256 |U| (channel-lithium).(driver).(uploadImageRequest): Download the following file: 0006YaBPQA0G045C to the following location: /opt/genesys/applications/SocialMsg/Workspace/lithiumsun_blade_1000_h400px.jpg
2016-07-28T11:24:35.738 Dbg 42256 |U| (channel-lithium).(driver).(uploadImageRequest): Document to file: C:\Users\jcsajtai\Desktop\sun_blade_1000_h400px.jpg - 132745 - image/jpeg
2016-07-28T11:24:35.779 Dbg 42256 |U| (channel-lithium).(driver).(uploadImageRequest): HTTP protocol: 1.0
2016-07-28T11:24:35.883 Dbg 42256 |U| (channel-lithium).(driver).(uploadImageRequest): Upload result status code: 403
2016-07-28T11:24:35.885 Dbg 42256 |U| (channel-lithium).(driver).(uploadImageRequest): Error. Response: <html><head><title>Error report</title><style><!--H1 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;} P {font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;}HR {color : #525D76;}--></style> </head><body><h1>HTTP Status 403 - </h1><HR size="1" noshade="noshade"><p><b>type</b> Status report</p><p><b>message</b> <u></u></p><p><b>description</b> <u>Access to the specified resource has been forbidden.</u></p></body></html>
2016-07-28T11:24:35.886 Dbg 42256 |U| (channel-lithium).(driver).(uploadImageRequest): Delete of the the following file was successful: /opt/genesys/applications/SocialMsg/Workspace/lithiumsun_blade_1000_h400px.jpg
2016-07-28T11:24:35.886 Dbg 42256 |U| (channel-lithium).(driver).(uninitializeUCSService): Closing UCS connection
2016-07-28T11:24:35.887 Std 47050 |U| (channel-lithium).(driver).(uploadImageRequest): File upload was unsuccessfull.

 

 

Thanks in advance,

Regards,

Judit

  • There are a couple of things I noticed. The URL you pasted appears to be missing a /. Here is the URL you pasted: 

     

    https://forum-stage.vfd2-testnet.de/restapi/vcusers/login/Hanni_Marteau/media/albums/default/public/images/upload?restapi.session_key=Uqnx0wRZnWyt3SJl76BxBwZ5W1MihRSVykcF2hgKmK4.&credentials.user=%2Fusers%2Flogin%2FHanni_Marteau&restapi.response_format=json

     

    There is a / missing after vc, corrected it would be: .../restapi/vc/users/login/...

     

    Also, you will want to make sure you are performing this request using HTTP POST as a multipart/form-data, we do not allow GET for upload. The upload requires that as part of the multipart/form-data body that the image.content field has the file content. One thing you might also check is that this specific user has access to upload images in our end-user UI to ensure they have proper permissions to perform the action.

     

     

  • AdamA's avatar
    AdamA
    Khoros Oracle

    There are a couple of things I noticed. The URL you pasted appears to be missing a /. Here is the URL you pasted: 

     

    https://forum-stage.vfd2-testnet.de/restapi/vcusers/login/Hanni_Marteau/media/albums/default/public/images/upload?restapi.session_key=Uqnx0wRZnWyt3SJl76BxBwZ5W1MihRSVykcF2hgKmK4.&credentials.user=%2Fusers%2Flogin%2FHanni_Marteau&restapi.response_format=json

     

    There is a / missing after vc, corrected it would be: .../restapi/vc/users/login/...

     

    Also, you will want to make sure you are performing this request using HTTP POST as a multipart/form-data, we do not allow GET for upload. The upload requires that as part of the multipart/form-data body that the image.content field has the file content. One thing you might also check is that this specific user has access to upload images in our end-user UI to ensure they have proper permissions to perform the action.

     

     

    • jcsajtai's avatar
      jcsajtai
      Contributor

      Hi Adam,

       

      Thanks for the help, the root cause was the missing '/' from the URL.

       

      Regards,

      Judit