Hello.
I am having an upload image system.
You upload a image, then you crop it and press save.
If you cancel this procedure at after you uploaded the image, the image will remain on the server.
So therefore i tried my idea of making a column in db called "failImage", so when you upload the image, it stores the filename e.g 1111.jpg in the column.
So later if you cancel this procedure either by shutting down the website or something else, next time you visit, I made a function that checks if failImage is empty.
If it isn't then it deletes (unlink) the value in failImage(which is in this example 1111.jpg) and emptys the failImage column.
This works fine.
But...if you have two windows of my site, and on the 1)st one you upload a image, and then at the 2nd one you refresh the window(f5) the function i made, that unlink the value in failImage runs, and will then occur an error to the previous window you have open, when you try to crop and save it, as it says no such file or directory, as the second window has removed the image you were working with.
I have thought of an solution to this for some time, is there any way I can solve this?