Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

PHP copy file

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

PHP copy file

Postby jp26198926 » 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.

thanks,
jp26198926
New php-forum User
New php-forum User
 
Posts: 5
Joined: Mon Apr 30, 2012 5:48 am

Re: PHP copy file

Postby seandisanti » 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.
seandisanti
php-forum Fan User
php-forum Fan User
 
Posts: 838
Joined: Mon Oct 01, 2012 12:32 pm

Re: PHP copy file

Postby johnj » 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.
johnj
php-forum Super User
php-forum Super User
 
Posts: 1805
Joined: Thu Mar 10, 2011 5:07 pm


Return to PHP coding => General

Who is online

Users browsing this forum: Google [Bot] and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.