Net change mechanism - not to upload files that already been uploaded previously but the uploaded file has been moved /renamedfile

Morning all,

I have a post-finish script working to rename the uploaded file to the original name and delete the info file. It moves the uploaded files to a username directory/timedatedirectory/orginalfilename and deletes the info file .so there is no files in the data directory, just the username directory etc…

if the user uploads the same file again, it seems like it knows the file should be there and when it does a head request , it respones with a 404 and creates a new upload
image

if i remove the post-finish file and upload a file, it creates the uploaded file and info file and stores it in the data directory
image
then i try to upload again it doesn’t upload them again - perfect

How can i replicate this with my post-finish file enabled (at the moment there is no file with id and info file in the data directory)

if i try to upload the file again and we have uploaded it previously, i don’t want it uploading it again

and i don’t want to go down the road of duplicating the file e.g. have the uploaded file +info file in the data directory as well as the orginal name files in the username directory

open to ideas

many thanks