strapi-provider-upload-google-cloud-storage icon indicating copy to clipboard operation
strapi-provider-upload-google-cloud-storage copied to clipboard

Buffer data saved in database when trying to replace distant file. No distant file uploaded on replace

Open anthonytison opened this issue 3 years ago • 1 comments

Describe the bug When trying to replace a distant file (on CDN), the new one is saved as Buffer in the database which results in 2 issues : It's not possible to delete the file afterward ( Remote file was not found, you may have to delete manually ) and the query for getting the data is slower due to the amount of buffering data to retrieve.

To Reproduce Steps to reproduce the behavior:

  1. Upload a file on a CDN
  2. Replace it by another file
  3. Try to remove it and get an issue saying the remote file was not found
  4. Query data including this image and check how long it takes for getting the data

Expected behavior Replace the file on the CDN and get the distant url. No buffer data saved in the different formats

Desktop (please complete the following information):

  • OS: mac osx Big sur
  • Browser chrome 100.0.4896.127

CDN Google cloud platform

anthonytison avatar May 13 '22 08:05 anthonytison

Hello @anthonytison,

I'm not sure to understand how it's possible to have buffer save in database instead of URL. Could you share your default configuration of the provider (without credential of course). Only all option and an example ?

When you "upload" a new file via the provider, this will create a new entry in media base url, this will not really "replace" the existing file.

Are you using Strapi 3 or 4 ? Which release of the plugin ?

Thanks

Lith avatar Jun 06 '22 10:06 Lith