moving files
Posted: Wed Jun 04, 2003 2:42 pm
I have been given upload rights from my host, but the directory i have writing permissions to is one higher then the actual webspace.
I already am able to write files to it. using this script:
Now...how do i get the files from "/usr/local/apache/www/myacount/phpupl/" to "/usr/local/apache/www/myacount/html/upload" with php script.
(Since there is no move() command in php.)
I already am able to write files to it. using this script:
Code: Select all
<?php
// copy to this directory
$dir="/usr/local/apache/www/myacount/phpupl/";
// copy the file to the server
if (isset($submit)){
if (!is_uploaded_file ($userfile)){
echo "<b>$userfile_name</b> couldn't be copied !!";
}
// check whether it has been uploaded
if (is_uploaded_file ($userfile)){
move_uploaded_file($userfile,$dir.$userfile_name) ;
}
echo "<b>$userfile_name</b> copied succesfully !!";
}
//note:extra security will added later, this is just an example.
?>(Since there is no move() command in php.)