imagekit-nodejs icon indicating copy to clipboard operation
imagekit-nodejs copied to clipboard

Issue with data image uploads in specified folders only

Open shanehoban opened this issue 1 year ago • 1 comments
trafficstars

For context, I'm using NextJS, but not sure if that's relevant - and I'm uploading images (specifically in .webp format), and via base64 strings.

If I specify an existing sub folder location, the file returns a not found error and the preview in the imagekit UI is also broken. If I download the file from the dashboard, the file can open and is viewable etc.

However, if I don't specify a sub folder, and create a new folder (e.g. a random string that represents a user ID), it works.

Example that works, this creates a new folder in the root of my account, and the image is there and works as expected:

imagekit.upload({
  folder: `${userId}`,
  file: file.src,
  fileName: file.fileName,
}),

Example that still creates the new folder as expected, and the file is present - but when linking to it, the files are not found and broken in the imagekit dashboard UI:

imagekit.upload({
  folder: `existing/folders/${userId}`,
  file: file.src,
  fileName: file.fileName,
}),

Any help appreciated!

shanehoban avatar Apr 09 '24 21:04 shanehoban

To update, the returned thumbnailUrl does in fact work, just not the actual url

shanehoban avatar Apr 10 '24 21:04 shanehoban

This was resolved via imagekit email support.

This issue was caused because I had a URL endpoint configured that matched the folder structure I was using. Removing the URL endpoint resolved the issue.

shanehoban avatar Apr 12 '24 14:04 shanehoban