Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
PHP How-To Post your "How do I do this with PHP?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the PHP How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old July 24th, 2006, 11:13 PM
Friend of Wrox
 
Join Date: Oct 2003
Location: colombo, WP, Sri Lanka.
Posts: 479
Thanks: 0
Thanked 3 Times in 3 Posts
Send a message via MSN to surendran Send a message via Yahoo to surendran
Default Copy folders

Hi frieds,
I'm trying to copy one folder with contants another location, without cut.


<?php
$file = 'example';
$newfile = 'example/newfolder';

if (!copy($file, $newfile)) {
   echo "failed to copy $file...\n";
}
?>

When i try with this code, i'm getting following error, please send me a solution for this.

Warning: copy(upload): failed to open stream: Permission denied in c:\inetpub\wwwroot\scan\copy.php on line 5
failed to copy upload...

surendran
(Anything is Possible)
__________________
surendran
(Anything is Possible)
http://www.suren.info
http://ssuren.spaces.msn.com
  #2 (permalink)  
Old July 25th, 2006, 07:27 PM
Friend of Wrox
 
Join Date: Jan 2006
Location: San Francisco, CA, USA.
Posts: 198
Thanks: 0
Thanked 0 Times in 0 Posts
Default

It seems to me like the code should work and it's an operating system permissions constraint that's causing it to fail. Do you have any command prompts or other applications currently using the "example" folder? Can you perform the copy using a command prompt manually?

Jon Emerson
http://www.jonemerson.net/
  #3 (permalink)  
Old July 25th, 2006, 10:36 PM
Friend of Wrox
 
Join Date: Oct 2003
Location: colombo, WP, Sri Lanka.
Posts: 479
Thanks: 0
Thanked 3 Times in 3 Posts
Send a message via MSN to surendran Send a message via Yahoo to surendran
Default

hai again,
It will work for single file, but not a folder, i need to move a folder with files using php code, any suggestions?

surendran
(Anything is Possible)


Similar Threads
Thread Thread Starter Forum Replies Last Post
paging folders solomon_13000 Classic ASP Professional 1 May 28th, 2006 09:12 AM
Copy Files and Folders on Local Network rupakroy5 VB.NET 2002/2003 Basics 1 May 22nd, 2006 10:09 AM
Copy files & Folders application in ASP.net rupakroy5 ASP.NET 1.0 and 1.1 Basics 0 May 8th, 2006 10:45 PM
Secure Folders itHighway Classic ASP Basics 5 December 16th, 2004 05:12 PM
Which folders to USE groupmatch BOOK: ASP.NET Website Programming Problem-Design-Solution 5 October 7th, 2004 07:52 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.