Image: Directory not created automatically for save() method

Created on 8 Dec 2013  路  6Comments  路  Source: Intervention/image

Hello guys, thank you for this amazing library. I am using its integration with Laravel 4 and it works wonderfully.

I encountered an error when trying to save an image to a directory that did not exist. It is not a permission problem, it is just a feature that is missing: create the directory first if it does not exists. Maybe its an easy fix, but I don't feel comfortable enough to modify the library myself...

Hope you guys can take a look into it for a future release.

Thank you!

Most helpful comment

Maybe let the choice to the developer with a config option and a default value?

All 6 comments

I am undecisive about this. It seems practical, if the save method creates directories automatically but on the other hand I think it's bad practice, if an Image class messes around in the filesystem.

Maybe let the choice to the developer with a config option and a default value?

I think it's bad practice.

Use mkdir to create directories (recursively).

I want to keep it simple, creating directories automatically may cause confusion.

Suggestion: Please add a flag in the intervention configuration, so the developer can decide if he want intervention to create directories?

+1

indeed i need this too

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kamov picture kamov  路  6Comments

REPTILEHAUS picture REPTILEHAUS  路  5Comments

samwalshnz picture samwalshnz  路  8Comments

divdax picture divdax  路  7Comments

cherrycoding picture cherrycoding  路  3Comments