> I already asked my provider if I have the rights to access the tmp/ file
and
> he says yes!

but does php also have the right to put in your webdirectory?
the problem is: php does not use your username and password.
what I did (and I don't know if you've got the same problem), is fread all
data from the tmp file into a string, fopen "w" a file in my webdirectory
where I use my username and password, put all data from the string into that
file.

hope it helps.

Leo Kuiper

"Building a map in order to find what's not lost but left behind."
 - Beth Orton


----- Original Message -----
From: Michael <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, December 10, 2001 4:16 PM
Subject: [PHP-DB] Problem with file upload...


> Hi to all,
>
> I'm developing a cms and need to upload an inage and a pdf-file to the
> server. Everything is just working fine, but when trying to upload any
file
> I get the following error:
>
> Warning: Rename failed (Invalid cross-device link)
> in/www/971/html/admin/object_add.php on line 115
>
> here's the code I'm using:
>
> if ($userfile != 'none') {
>            $b_id = mysql_insert_id();
>            $bildpfad = '$pathname';
>            $bildname = 'foto'.$b_id;
>            $pfadname = $bildpfad.$bildname;
>            echo $userfile;
>            if (rename($userfile,$pfadname)) {
>                echo "Datei $bildname wurde verschoben";
>                $bild_url = 'fotos/'.$bildname;
>            }
>            else echo ('Bild wurde nicht verschoben');
>            echo $pfadname;
>            $sql = "update objekte set bild_url = '$bild_url' where obj_id
=
> '$b_id'";
>            echo $sql;
>            $res = mysql_query($sql);
>            if ($res) {
>                echo ("Die Bilddaten wurden gespeichert<br>");
>            }
>            else {
>                echo ("Probleme beim speichern des Bildes: " .
> mysql_error()."<br>");
>            }
>        }
>
> I hope somebody can help with this as I already spent several days without
> results :-((
>
> I already asked my provider if I have the rights to access the tmp/ file
and
> he says yes!
>
> Regards,
> Michael
>


-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to