PHP copy file

Ask about general coding issues or problems here.

Moderators: egami, macek, gesf

Post Reply

Wed Apr 03, 2013 11:29 pm

Hello guys,

how do i copy file which is lock or open by another application?
i tried the copy function but it doesnt work.


php-forum Fan User
php-forum Fan User
Posts: 974
Joined: Mon Oct 01, 2012 12:32 pm

Thu Apr 04, 2013 12:44 am

You should be able to fopen() for read only access, then write to new file. at best it gives you a copy of file at the last save.

php-forum Super User
php-forum Super User
Posts: 1803
Joined: Thu Mar 10, 2011 5:07 pm

Thu Apr 04, 2013 1:13 am

Try reading the locked/opened file. If you are not able to read then it means that you do not have enough permission to do that activity. Change the permission using the built-in php function called chmod() and read the file.

Post Reply