Page 1 of 1
uploading same files in different directories
Posted: Tue Jul 15, 2003 5:12 pm
by Jeremy108
I would like to upload a file and have it simeltaneously copied to a seperate directory. Possible?
Thanks,
Jeremy
Posted: Tue Jul 15, 2003 5:52 pm
by daven
I do not think it is possible to do a simultaneous copy, but you can always do a copy('current_location','other_location') after the file is uploaded
Posted: Tue Jul 15, 2003 6:59 pm
by Jeremy108
I tried the following script on an NT server:
<?php
if(!copy("test.txt", "/testdir/")) die ("Can't copy the file copyme.txt to copied.txt!");
?>
and this is the error message I get:
Warning: copy(/testdir/) [function.copy]: failed to create stream: Permission denied in D:\Inetpub\SecurityWeb\board\copy.php on line 2
Can't copy the file copyme.txt to copied.txt!
Any ideas?
Thanks,
Jeremy
Posted: Tue Jul 15, 2003 7:01 pm
by Jeremy108
oh yeah, I forgot to mention, I made sure the permssions on the file and the folder is set to read, write, execute and delete and still same error message.
Posted: Wed Jul 16, 2003 1:29 pm
by daven
You need to supply the full path for the copy destination (ex: c:\myDir\copied.txt)