Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for abandoned files #80

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ndiggity
Copy link

The Upload URL and Crop URL processing files are perfect for processing uploaded and cropped files as required. However, there is no support for files which are abandoned by a user in either the uploaded or cropped stages. These can of course be removed manually or by a CRON job... but why not add functionality here to deal with them before they pile up and to eliminate the possibility of manual removal or a CRON job from interfering with a user.

I added such functionality to the croppic.js and made a sample processing file. I modeled the code on the existing code to facilitate additions if needed.

The Upload URL and Crop URL processing files are perfect for processing uploaded and cropped files as required.  However, there is no support for files which are abandoned by a user in either the uploaded or cropped stages.  These can of course be removed manually or by a CRON job...  but why not add functionality here to deal with them before they pile up and to eliminate the possibility of manual removal or a CRON job from interfering with a user.  

I added such functionality to the croppic.js and made a sample processing file.  I modeled the code on the existing code to facilitate additions if needed.
@sconsult
Copy link
Owner

Interesting approach, i will take a look at the code, looks as mergable on the first glance ;-)
thank you for the effort, will let you know

@segux
Copy link

segux commented May 27, 2015

did u implemented an automatic action to delete temp files older than some time?
like this?
//Delete all temporal files older than 1 hour
$files = glob("temp/*");
$now = time();
foreach ($files as $file){
if (is_file($file))
if ($now - filemtime($file) >= 60 * 60) // 1 hour
unlink($file);
}

@sconsult
Copy link
Owner

Hi segux

We decided to not merge it into the master but leave the pull request open for others as reference.

Mat

@segux
Copy link

segux commented May 27, 2015

Well, by the way, thanks for your repository. Clean code and easy to modify it.

I had lot of problems with my hosting server, because on actions like "is_writable(dirname($output_filename))" i needed to write the absolute root of file like this: "/home/path/public_html/web/assets/img/"

I hope this will solve some problems of permissions in the future.

Thanks for all. segux

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants