I need to check if a file exists in local dir and the file is totally uploaded. To be more specific in my application (in LAMP environment) the users have an FTP access to upload file in a local dir. My objective is to check if a new file has been uploaded into the dir. If i use file_exists() function I obtain true even when the file is uploading, instead I want to know if a file exists and has been completely uploaded. Any idea to catch this event?
Asked
Active
Viewed 86 times
1
-
have you tried checking [file size](http://php.net/manual/en/function.filesize.php)? – Jeff Puckett Apr 14 '16 at 15:23
-
File size won't workout as it won't know what is the total size – Arjun J Gowda Apr 14 '16 at 15:42
-
Yes. I try to use filesize() calling this function twice with an acceptable delay and check if two result are different but this solution doesn't satisfy me completely. – Francesco D'Auria Apr 14 '16 at 16:32