Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getFileUrl function doesn't work #8

Open
keeniGithub opened this issue Sep 19, 2024 · 0 comments
Open

getFileUrl function doesn't work #8

keeniGithub opened this issue Sep 19, 2024 · 0 comments

Comments

@keeniGithub
Copy link

keeniGithub commented Sep 19, 2024

When I try to send a request, it writes an error 400 bad request, I tried to find the answer in the documentation and the problem is that the file id that we have does not work to receive the link

function getFileUrl(fileId: Id<"_storage">): string{
    return `${process.env.NEXT_PUBLIC_CONVEX_URL}/api/storage/${fileId}`
}

image

here is the code in which I call the function

{
  file.type === "image" && <Image alt={file.name} width="200" height="100" src={getFileUrl(file.fileId)}/>
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant