Hi all,
I use NuxtJS 3 with the Web SDK and a self hosted Appwrite backend. I have a dropdown select which lets me switch between video files. But if I call a video a second time I get a messedup URL.
I use the SDK in a composable to generate similar returns:
const getPreviewUrlVideo = async (fileid: string) => {
const { storage } = useAppwrite();
try {
const res = await storage.getFileView(VIDEO_BUCKET, fileid);
return { success: true, data: res, error: null };
} catch (err) {
if (err instanceof AppwriteException) {
return {
success: false,
data: null,
error: err.message,
};
} else {
return {
success: false,
data: null,
error: "Unkown Error",
};
}
}
};
I used the VS Code Debugger and the URL is coming this way out of the SDK function. Is this a Bug? Should I report it on GitHub?
What's being passed in as the file id the second time?
You solved the problem with just one question. I don’t have to look into the code to now that the url is on the field of the fieldid because I overwrite the fieldid property with the url and if I don’t reload the page it does not change. Thanks a lot @Steven for pushing me in the right direction 🥰
[SOLVED] Web SDK storage creates with second fetch messupd URLs
Recommended threads
- Query Appwrite
Hello, I have a question regarding Queries in Appwrite. If I have a string "YYYY-MM", how can I query the $createdAt column to match this filter?
- Different appwrite IDs are getting expos...
File_URL_FORMAT= https://cloud.appwrite.io/v1/storage/buckets/[BUCKET_ID]/files/[FILE_ID]/preview?project=[PROJECT_ID] I'm trying to access files in my web app...
- Invalid document structure: missing requ...
I just pick up my code that's working a week ago, and now I got this error: ``` code: 400, type: 'document_invalid_structure', response: { message: 'Inv...