Closed PratikPradhan987 closed 1 month ago
Hey, the issue you're facing is that you're not uploading the files. That endpoint just requests some presigned URLs. You then need to upload the file's content to those URLs.
If you compare to our v6 SDK, this is the step you've done: https://github.com/pingdotgg/uploadthing/blob/legacy-docs/packages/uploadthing/src/sdk/utils.ts#L135
You then need to post the files:
You can do it much simpler by using the v7 by generating a presigned URL yourself and uploading to our ingest servers. That's explained here: https://docs.uploadthing.com/uploading-files.
Provide environment information
Describe the bug
crypto.createHash('md5').update(randomString).digest('hex') +
.${fileExtension}
; i am using crypto to update to random name for the fileconst data = { files: updatedFiles.map((file) => ({ name: file.file.name, size: file.file.size, type: file.file.type, })), acl: 'public-read', contentDisposition: 'inline', }; const options = { method: 'POST', url: 'https://api.uploadthing.com/v6/uploadFiles', headers: { // 'Content-Type': 'application/json', 'X-Uploadthing-Api-Key': process.env.NEXT_PUBLIC_UPLOADTHING_SECRET }, data: data }; const res = await axios.request(options);
Link to reproduction
https://youtu.be/TyXj5a5Uqgc?si=gx0-chYFTD-MxaBI
To reproduce
https://youtu.be/TyXj5a5Uqgc?si=gx0-chYFTD-MxaBI
not able to share the repo but create a video
Additional information
https://youtu.be/TyXj5a5Uqgc?si=gx0-chYFTD-MxaBI
not able to share the repo but create a video
๐จโ๐งโ๐ฆ Contributing
Code of Conduct