I have a upload function to upload word or pdf file. It works fine. But I just found that if the file is opened, and I upload that file at the same time, the file will not be uploaded successfully.

I would like to know if there are any ways to solve it?

Thank you.