Rank 3: Container
Hi, I seem to be running an issue with my UploadFile Script.
It doesnt seem to give an error code back i can actually do something with:
at _Client.call (webpack-internal:///(action-browser)/./node_modules/node-appwrite/dist/client.js:275:13) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async _Client.chunkedUpload (webpack-internal:///(action-browser)/./node_modules/node-appwrite/dist/client.js:220:14) at async Storage.createFile (webpack-internal:///(action-browser)/./node_modules/node-appwrite/dist/services/storage.js:303:12) { code: 500, type: 'general_unknown', response: { message: 'Server Error', code: 500, type: 'general_unknown', version: '1.5.1' }}```Code where it goes wrong:
```jsxexport async function UploadFile(file) { const File = file.get("file"); const client = await createAdminClient(); const storage = new Storage(client); const fileExists = await CheckIfFileExists(File.name); if (!fileExists) { const uploadResponse = storage.createFile( process.env.NEXT_PUBLIC_BUCKET_ID, ID.unique(), File ); return uploadResponse.$id; } else { const files = await storage.listFiles(process.env.NEXT_PUBLIC_BUCKET_ID); const existingFile = files.files.find((files) => files.name === File.name); return existingFile.$id; }}