Issue using files uploaded to CFS via REST

I am able to upload a file via the CFS REST endpoint, per info that I received from HERE.  The result of which lis below.

{
    "UploadedFile": {
        "UploadContextId": "3b8e7a1a-e2ea-43e2-b69d-8fff54426ddf",
        "DownloadUrl": "http://xyz.telligentdemo.com/cfs-file/__key/CommunityServer-Components-MultipleUploadFileManager/3b8e7a1a_2D00_e2ea_2D00_43e2_2D00_b69d_2D00_8fff54426ddf-2107-complete/test.png",
        "TotalChunks": 1,
        "CurrentChunk": 1,
        "FileName": "test.png"
    },
    "Errors": null
}

The problem is that the URL returned doesn't work.  If you go to it in a web browser it goes to a Telligent page that says, "Unfortunately, the page you've requested no longer exists. Please use the search form above to locate the information you're interested in."

And using this URL when creating a new content item via REST (using the content syntax below) results in a broken image in the content.

Body: '<p>This is a TEST</p><p>[View:https://xyz.telligenthosting.net/cfs-file/__key/CommunityServer-Components-MultipleUploadFileManager/3b8e7a1a_2D00_e2ea_2D00_43e2_2D00_b69d_2D00_8fff54426ddf-2109-complete/test.png:350:150]</p>',

Any ideas on what I am doing wrong?  Or perhaps this is an indication that the CFS isn't properly configured?

Thanks.

Parents
  • Hi . Are you able to upload files through the UI, such as in a media gallery? That uses the same REST endpoint. You can see it in action if you monitor network requests in a browser. Upon inspecting the response in Chrome, the DownloadUrl returned from the temporary upload endpoint works in that scenario as well.

    If that works, it's probably not a CFS configuration issue.

    How are the REST requests being issued? Would it be possible to share some code?

  • Thanks for the reply Michael, it ended up solving my issue.

    Are you able to upload files through the UI, such as in a media gallery? That uses the same REST endpoint.

     

    It appeared to use a different URL.  The REST call was to /api.ashx/v2/cfs/temporary.json, but the Gallery uses /multipleupload.  Regardless, it solved my problem.  When I was looking at the Gallery I noticed that it was passing index "0" for the first chunk of the image.  My issue was that I was assuming that the index "1" was the first chunk.  So, changing the first chunk from "1" to "0" solved the problem.

    Many thanks.

Reply
  • Thanks for the reply Michael, it ended up solving my issue.

    Are you able to upload files through the UI, such as in a media gallery? That uses the same REST endpoint.

     

    It appeared to use a different URL.  The REST call was to /api.ashx/v2/cfs/temporary.json, but the Gallery uses /multipleupload.  Regardless, it solved my problem.  When I was looking at the Gallery I noticed that it was passing index "0" for the first chunk of the image.  My issue was that I was assuming that the index "1" was the first chunk.  So, changing the first chunk from "1" to "0" solved the problem.

    Many thanks.

Children