I recently upgraded my LAMP to Ubuntu 16.04 with Dropbox v43.4.50 syncing to this folder/home/arya/Dropbox (NAMA).
I have a PHP script that needs to use a specific file within the Dropbox folder. So, I do file_exists('file:///home/arya/Dropbox (NAMA)/CERTIFICATION/PACE/PACE.xls'), but it returns FALSE. The strange thing is that before I upgraded, file_exists() returned TRUE for this file.
So, I tested to see if the Dropbox folder is being detected by file_exists(), via file_exists('file:///home/arya/Dropbox (NAMA))' and, yes, it returns TRUE.
Then, I tested the next sub-directory file_exists('file:///home/arya/Dropbox (NAMA)/CERTIFICATION)' and it returns FALSE.
So, I thought that maybe the permissions were wrong, but they are correct. I am the owner of all the files and I tested file_exists() on other files outside my Dropbox folder and they are detected.
Also, I made sure the spelling of the folders/files are correct (I copied it from the URL bar in Nautilus to be extra sure) and all the files are accessible outside my PHP script.
Also, I the Dropbox folders have completed their syncing. Every once in a while, one of my co-workers will update another file in Dropbox, but the sync only takes a minute and they never edit the file that I am trying to use in this post.
So, I am now thinking that there is a significant difference occurring between the root Dropbox folder (Dropbox (NAMA)) on my computer and the contents of that folder that are synced/syncing (e.g., Dropbox (NAMA)/CERTIFICATIONS).
Any ideas about why file_exists is not detecting Dropbox sub-folders?
UPDATE:
Based on comments, I tried /path/to/file instead of file:///path/to/file, so file_exists('/home/arya/Dropbox (NAMA)/CERTIFICATION/PACE/PACE.xls'), and it still returned FALSE.
UPDATE:
var_dump(exec("ls -al /home/arya",$Output)); shows that there are 6 files in /home/arya/Dropbox (NAMA), but var_dump(exec("ls -al /home/arya/Dropbox (NAMA)",$Output)); shows nothing...Why?
/path/to/fileinstead offile:///path/to/file, though that technically shouldn't make any difference. - Alex Howansky/path/to/fileand it didn't make a difference. - Arya