strapi-community / strapi-provider-upload-google-cloud-storage

Google Cloud Storage Upload Provider for Strapi
MIT License
211 stars 91 forks source link

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

Open anthonytison opened 2 years ago

anthonytison commented 2 years ago

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):

CDN Google cloud platform

Lith commented 2 years ago

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