Re: copy after upload pblm (?path?)
| From: | Miguel Cruz | Date: | Sun, 19 May 2002 17:29:59 +0000 |
| Subject: | Re: copy after upload pblm (?path?) | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-98370@lists.php.net to get a copy of this message | ||
1) You probably need to move the file from the temporary directory to
somewhere in your own personal directory hierarchy.
2) http://php.net/move_uploaded_file
miguel
On Sun, 19 May 2002, arnaud gonzales wrote:
> Hi all,
> I' m trying to copy an uploaded file:
>
> if(!empty($fichier)) {
> $nom = $HTTP_POST_FILES["fichier"]["name"];
> $type = $HTTP_POST_FILES["fichier"]["type"];
> $taille = $HTTP_POST_FILES["fichier"]["size"];
> $nom_tmp = $HTTP_POST_FILES["fichier"]["tmp_name"];
> echo "nom : $nom <br> type : $type <br> taille : $taille <p> nom
> temporaire : $nom_tmp</p>;
> if(!strpos($nom, .gif") === FALSE || !(strpos($nom, ".jpg") === FALSE)){
> ---> $res = copy($fichier,$nom);
> if ($res != 0) {
> $msg = "<p> File save </p>";
> }else{
> $msg = "<p> saving Error </p>";
> }
> }else{
> $msg = "<p> wrong type </p>";
> }
> ?>
>
> and i get the error "Warning: open_basedir restriction in effect. File is in
> wrong directory in d:\tsunami\zeg\9\exo4upload.php on line 5"
> so is there any wrong path for $res = copy($fichier,$nom);
> should i use an absolute path?
>
> TIA
>
>
>