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 

Reply via email to