Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > PHP How-To
|
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
 
Old May 21st, 2005, 12:22 AM
Registered User
 
Join Date: Sep 2003
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Copy a image file using exec function

I wanted to copy a file by using exec function of php
which executes command prompt line.

my syntex is :

$FilePath="G:\files\";
$UploadFileName=$FilePath."BJ004.gif";
$ConvertedFileName=$FilePath."FK.gif";
exec ("copy ".$UploadFileName." ".$ConvertedFileName);

But when I run the php file it gives an error

Error is :
Warning: Unable to fork [copy D:\files\BJ004.gif D:\files\FK.gif] in d:\nsdocs\cms\phpinfo.php on line 16

I thought it is my problem.
so I tried in different way.
That is I ran it by using dos prompt.

and esecuting it
D:>copy D:\files\BJ004.gif D:\files\FK.gif
1 file(s) copied.

and it has copied successfully.

so how can I solve my problem.
I wanted to copy from php by using exec command.
Pls help me.
If some one knows how to solve pls mail me at :
[email protected]

 
Old May 29th, 2005, 04:46 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 836
Thanks: 0
Thanked 0 Times in 0 Posts
Default

What version of PHP are you using?





Similar Threads
Thread Thread Starter Forum Replies Last Post
Copy kodak image edit control's image to clipboard vishwanathduddilla Visual Studio 2005 0 November 3rd, 2008 10:10 AM
create Exec File angelboy Java Basics 4 January 23rd, 2008 03:10 AM
Error handle - stop exec. of parent function crisan Access 2 September 27th, 2005 01:55 AM
EXEC function ajutla Beginning PHP 0 August 19th, 2004 09:18 AM
EXEC function not returning values aingalsbe PHP How-To 0 June 1st, 2004 10:03 AM





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