When a file is uploaded to our server, we have to do some work on it to allow or reject it.
Some files need to be opened in a Windows box (OpenXml Sdk performance reasons).
Our web server runs in a Linux box. There is also a samba share in Linux.
As a file is uploaded, php copies it to that shared folder so the new file can be accessed by everyone.
When the copy is done, php sends a message to the Windows machine saying:
Scan //Linux.Share.Ip/SharedFolder/FileJustUploaded.rtf
But we get a File Not Found !
If we poll the filesystems, the file appears in the shared folder as expected after short period of time (miliseconds to couple of seconds).
Let the shared folder be /opt/sharedFolder
Linux Ip: 192.168.1.10
Windows Ip : 192.168.1.11
At first, php was copying the files into /opt/sharedFolder.
In a try to make samba aware of the creation of the new file, we have mounted in /mnt/sharedFolder our own shared folder.
mount -t cifs //192.168.1.10/sharedFolder /mnt/sharedFolder
consequently php moves new uploads to /mnt/sharedFolder and then send the message to windows requesting Scan //192.168.1.10/SharedFolder/FileJustUploaded.rtf
No Luck :(
So, if i am getting this right, the Scan message makes windows request the file to samba before samba has broadcasted the existence of that file, hence the error.
Can we make something to prevent this from happening?
Can we change something to prevent this from happening?
Is there a "right way/best prectices" of doing this? I mean, using DFS or another filesystem (available in windows AND Linux) would fix this ?
Any suggestions are more than welcome.