nhost / hasura-storage

Storage for Hasura built on top of S3

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Wrong file name when downloading file, always getting 'document' as file name

alveshelio opened this issue · comments

I'm uploading a file my-filename.pdf with

const { fileMetadata, error: uploadError } = await storage.upload({
  file,
  name: file.name,
  bucketId: `myBucket`,
})

And then I'm retrieving the file as follow:

const getFileUrl = async (): Promise<void> => {
  const { presignedUrl, error } = await storage.getPresignedUrl({
    fileId: data?.profile?.file?.id,
  })

  if (!error) {
    window.open(presignedUrl?.url, '_blank')?.focus()
  }
}

When opening the file in a new window and downloading the file, the name of the file is always document.fileExtension. I'd expect the file name to be used instead of document

Which version of hasura-storage are you running?

I have "@nhost/nextjs": "^1.0.11" and "@nhost/react": "^0.5.1",

@dbarrosop Is this the info you where asking for?

no, not exactly, I was wondering about the server itself. If you are running it in your dev machine you can probably check the container image with docker ps. If you are consuming it via nhost's cloud you can reach out to me via discord and I can check it for you.

So I'm using
nhost/hasura-storage:sha-623f285 and minio/minio:RELEASE.2021-09-24T00-24-24Z

Ok, thanks. Are you using the nhost cli? If yes, we are releasing a new version of the cli that will update hasura-storage later today so I will ask you to test after that as I couldn't reproduce the issue with that version. If you are running it somehow else let me know and I can provide you with instructions to update hasura-storage.

Would you mind testing using the latest nhost cli? https://github.com/nhost/cli/releases/tag/v0.6.6

Hi @dbarrosop,

After upgrading to V.06.6 I can confirm that the problem is solved.

Thank you

Hi @dbarrosop,

I'd like to know if this has been pushed to production. In local I have Nhost CLI version v0.6.8 and I'm running I have nhost/hasura-storage:0.1.5 and minio/minio:RELEASE.2021-09-24T00-24-24Z.

Even though in local I now have the correct file name, in production I'm still getting document as file name.

Thanks.

It's been done for most applications but we held off for some "old" users of hasura-storage. If you ping me on discord or let me know your subdomain I can make sure your application is up to date.

We just decided to upgrade the remaining apps so yours should be too. Let me know if it is working now. Thanks!

I am closing this one as I think everything should be fine, otherwise, feel free to reopen.

Thanks!