imagekit-developer / imagekit-nodejs

Node.js SDK for ImageKit.io API.
https://imagekit.io
Other
84 stars 32 forks source link

Issue with data image uploads in specified folders only #95

Closed shanehoban closed 6 months ago

shanehoban commented 6 months ago

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 commented 6 months ago

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

shanehoban commented 6 months ago

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.