Baboo7 / strapi-plugin-import-export-entries

Import/Export data from and to your database in just few clicks.
179 stars 95 forks source link

[BUG] On import, images are re-uploaded to AWS s3 bucket #146

Closed johnark88 closed 10 months ago

johnark88 commented 1 year ago

Describe the bug When importing a JSON file (that was exported) to a new database the image url in the database is different than the one that was exported. It looks like it is maybe re-uploading the image to the S3 bucket, but the image is broken. Because it is broken the mime type comes up as text/html. I have copied the image down from our S3 and the size is 2.0 KiB (the actual size should be 171KiB ) and when I open the image it fails and says it's broken. Any advice/help would be great. Thank you.

partial of JSON exported

     }
    },
    "plugin::upload.file": {
      "21": {
        "id": 21,
        "name": "join-4.png",
        "alternativeText": null,
        "caption": null,
        "hash": "join_4_258216dc66",
        "ext": ".png",
        "mime": "image/png",
        "url": "https://site.com/cms-assets/join_4_258216dc66.png",
        "createdAt": "2023-09-27T20:30:17.022Z",
        "updatedAt": "2023-09-27T20:30:17.022Z",
        "createdBy": null,
        "updatedBy": null
      },
      "22": {

This is the URL after import in the database - https://site.com/cms-assets/join_4_dc8c03430c.png Screen Shot 2023-09-27 at 2 00 08 PM

To Reproduce Steps to reproduce the behavior:

  1. Export existing page with images (from an aws s3 bucket)
  2. On a fresh install, import the page with images again
  3. Image previews are broken in the content-manager as the mime type is text/html and the URL is not the same as the export one. The images in the Media Library are also broken.

Expected behavior The URL should be the same as the one exported as its an existing asset.

Additional context We are on strapi 4.12.5 We are using AWS S3/Cloudfront with @strapi/provider-upload-aws-s3 @ 4.12.5

Thank you.

Baboo7 commented 11 months ago

@johnark88 checkout verson 1.22.1 where media import is much more stable