ID from direct_upload differs from final image ID, rendering direct upload practically useless

Hi!

I want my users to be able to upload images, and in addition keep track of what user uploaded which image.

When creating an authenticated direct upload URL, the response body looks like this:

{
  "success": true,
  "errors": [],
  "messages": [],
  "result": {
    "uploadURL": "https://upload.imagedelivery.net/fgr33htrthytjtyereifjewoi338272s7w1383",
    "id": "ZxR0pLaXRldlBtaFhhO2FiZGVnaA"
  }
}

The result.id differs from the id of the image created when the specified uploadURL is used.

How is one supposed to which user uploaded which image when this method is used, when there’s no way to attach metadata to the authenticated direct upload, no Webhook for tracking Direct Creator Upload, and to top it off, the IDs returned are different?

I can’t imagine my use case is in any way unique, and I’d even assume this is a common use case, and can’t why the direct upload would even exist without this use case in mind.

Just to clarify, upload an image to:
POST https://upload.imagedelivery.net/3321f152-6787-4572-9f52-c30b0828cd6a
returned:

{
  "result": {
    "id": "189d347a-cda3-4b4a-2b06-5edc8fa5a900",
    "filename": "cool_image.png",
    "uploaded": "2021-10-22T08:47:59.981Z",
    "requireSignedURLs": false,
    "variants": []
  },
  "result_info": null,
  "success": true,
  "errors": [],
  "messages": []
}

Instead of the expected (or at least useful):

{
  "result": {
    "id": "3321f152-6787-4572-9f52-c30b0828cd6a",
    "filename": "cool_image.png",
    "uploaded": "2021-10-22T08:47:59.981Z",
    "requireSignedURLs": false,
    "variants": []
  },
  "result_info": null,
  "success": true,
  "errors": [],
  "messages": []
}

I had an issue with upload calls processing twice, and generating two different id’s.
It was due to the browser call for favicon.ico.

This doesn’t affect direct creator uploads, where the upload URL is only valid for a single upload.

This topic was automatically closed after 15 days. New replies are no longer allowed.