In my site, i have created functionality to upload MS-Word Document.
and i’m moving that file using following PHP function
move_uploaded_file($_FILES['upload_file']['tmp_name'],$path);
I just want to know What happens if file(word document) is open while uploading it?
does it create any problem or generate any error?
Depends on how Word behaves. If it is in the middle of a write, then you’ll either get a corrupted file or the OS will make the browser wait before uploading it. But this is a rare occurrence.
If the document is open, but Word is not currently writing you will either get an old version of the file, or a semi-saved corrupted state.
Best not risk it, and tell the user to close the file first.