[GH-ISSUE #519] Save images in readable paths #795

Closed
opened 2026-03-15 15:30:52 +03:00 by kerem · 3 comments
Owner

Originally created by @adiltibari on GitHub (Oct 1, 2024).
Original GitHub issue: https://github.com/flyimg/flyimg/issues/519

Originally assigned to: @sadok-f on GitHub.

Is there a way to make flyimg save images that are being optimized on a readable path?

so if the image url is :
https://cdn.test.com/upload/q_56/https://demo.net/storage/app/public/product/2024-07-03-6685bab14071f.png

it will save it to :
demo.net(folder)/storage(folder)/app(folder)/public(folder)/product(folder)/2024-07-03-6685bab14071f.png

Originally created by @adiltibari on GitHub (Oct 1, 2024). Original GitHub issue: https://github.com/flyimg/flyimg/issues/519 Originally assigned to: @sadok-f on GitHub. Is there a way to make flyimg save images that are being optimized on a readable path? so if the image url is : https://cdn.test.com/upload/q_56/https://demo.net/storage/app/public/product/2024-07-03-6685bab14071f.png it will save it to : demo.net(folder)/storage(folder)/app(folder)/public(folder)/product(folder)/2024-07-03-6685bab14071f.png
kerem 2026-03-15 15:30:52 +03:00
Author
Owner

@sadok-f commented on GitHub (Oct 2, 2024):

Thank you @adiltibari for opening this issue!
If I get you right, you want to change the location where the generated images are being stored?

if yes, is the new path a fixed path?

currently the images are stored in the upload folder under the public folder web.
if you want to change that, to a fixed path, you need to create the desired path:

mkdir -p web/storage/app/public/product

and then change the UPLOAD_WEB_DIR constant to 'storage/app/public/product/' in the constants.php file

to get the image path, you need to call the path endpoint.
example:

https://cdn.test.com/upload/q_56/https://demo.net/storage/app/public/product/2024-07-03-6685bab14071f.png

Call the path endpoint:

https://cdn.test.com/path/q_56/https://demo.net/storage/app/public/product/2024-07-03-6685bab14071f.png

the image is available under
https://cdn.test.com/storage/app/public/product/4eaf3878f10741f3cc1c9809131f961b.png

I hope I make it clear

<!-- gh-comment-id:2388308968 --> @sadok-f commented on GitHub (Oct 2, 2024): Thank you @adiltibari for opening this issue! If I get you right, you want to change the location where the generated images are being stored? if yes, is the new path a fixed path? currently the images are stored in the `upload` folder under the public folder web. if you want to change that, to a fixed path, you need to create the desired path: ```sh mkdir -p web/storage/app/public/product ``` and then change the `UPLOAD_WEB_DIR` constant to `'storage/app/public/product/'` in the constants.php file to get the image path, you need to call the path endpoint. example: https://cdn.test.com/upload/q_56/https://demo.net/storage/app/public/product/2024-07-03-6685bab14071f.png Call the path endpoint: https://cdn.test.com/path/q_56/https://demo.net/storage/app/public/product/2024-07-03-6685bab14071f.png the image is available under `https://cdn.test.com/storage/app/public/product/4eaf3878f10741f3cc1c9809131f961b.png` I hope I make it clear
Author
Owner

@adiltibari commented on GitHub (Oct 8, 2024):

is the new path a fixed path

Hi, The new path is dynamic and depends on the domain name & the path of the image in that domain, the idea is to have the upload directory organized and easy to navigate.

<!-- gh-comment-id:2399633894 --> @adiltibari commented on GitHub (Oct 8, 2024): > is the new path a fixed path Hi, The new path is dynamic and depends on the domain name & the path of the image in that domain, the idea is to have the upload directory organized and easy to navigate.
Author
Owner

@sadok-f commented on GitHub (Oct 10, 2024):

I see, unfortunately Flyimg doesn't support that.

<!-- gh-comment-id:2404267131 --> @sadok-f commented on GitHub (Oct 10, 2024): I see, unfortunately Flyimg doesn't support that.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/flyimg#795
No description provided.