Baboo7 / strapi-plugin-import-export-entries

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

How to upload files with folder_path? #145

Closed amityweb closed 1 month ago

amityweb commented 1 year ago

When I upload files they go into the / folder. I added path into the JSON, but its not taking effect completely. In the table files_folder_links, folder_id is correctly set. But in the table files, folder_path is set to /. Strapi is using this folder path to show the image in the correct folder in Admin. Therefore even though the folder shows x number of images inside it, the images are not actually in there, and are all in the root /.

So can one have the folder_path also updated to the folder path?

This is my json for into:

{
    "version": 2,
    "data": {
        "plugin::upload.file": {
            "150": {
                "ext": ".jpg",
                "mime": "image/jpeg",
                "path": "/11",
                "url": "https://www.mydomain.com//my-image.jpg",
                "createdAt": "2023-03-10T21:14:54.216Z",
                "updatedAt": "2023-03-10T21:14:54.216Z",
                "createdBy": 4,
                "updatedBy": 4
            }
        },
        "plugin::upload.folder": {
            "11": {
                "id": 11,
                "name": "Categories",
                "pathId": 11,
                "path": "/11",
                "createdAt": "2023-06-22T17:56:48.712Z",
                "updatedAt": "2023-06-22T17:56:48.712Z",
                "parent": null,
                "children": [],
                "files": [
                    150
                ],
                "createdBy": null,
                "updatedBy": null
            }
        }
    }
}

Thanks

amityweb commented 9 months ago

Just resurfacing this I hope... because I am doing another import and have the same issue again. Last time I had to update the databsse directly to change the path IDs so they would appear in the correct folder in Strapi. Thanks