• Jetzt anmelden. Es dauert nur 2 Minuten und ist kostenlos!

move_upload_files

Status
Für weitere Antworten geschlossen.

lukeelten

Neues Mitglied
hallo

ich habe ein upload script geschrieben, aber es funzt nicht. alles was auf dem server ist hat CHMOD 777 rechte, ich weiss nicht woran es liegt. hier könnt ihr das script sehen:

http://www.scifi-games.com/content/upload_tut.php






Code:
<?php
if (isset($HTTP_POST_VARS['exsist'])) {
  $type = $HTTP_POST_VARS['type'];
  $maxsize = 60000000;
       if($_FILES['upload']['size'] <= $maxsize){
         if($type == "php"){
            $path = "/content/upload/php_tut/";
            $dtyp = ".php";
            
        }
        if($type == "flash"){
              $path = "/content/upload/flash_tut/";
             $dtyp = ".fla";
             
        }
        $time = time();
        $name = $time.$dtyp;
        $update = $_FILES['upload']['tmp_name'];
        $abfrage = move_uploaded_file($update,$path.$name);
        if($abfrage)
        {
        $errorwarning = $path.$name;
        }
        else
        {
        $errorwarning = "Datei konnte nicht hochgeladen werden!";
        }
}
}

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<style type="text/css">
<!--
body,td,th {
    color: #FFFFFF;
}
-->
</style></head>

<body>
<form action="<?php echo $_SERVER['SELF_PHP']; ?>" method="post" enctype="multipart/form-data">
<table width="400" border="0" align="center" cellpadding="0" cellspacing="1" background="/images/style/sfg_style/news_main.gif">
  <tr>
    <td colspan="2" bgcolor="#042638"><div align="center">[b]Datei-Upload[/b]</div></td>
  </tr>
  <tr>
    <td colspan="2"><?php echo $errorwarning."
".$path.$name."
".$abfrage."
".$update; ?></td>
  </tr>
  <tr>
    <td width="40%" bgcolor="#042638">Flash oder PHP?</td>
    <td width="30%"><label>
      <select name="type">
        <option value="php">PHP (.php)</option>
        <option value="flash">Flash (.fla)</option>
      </select>
    </label></td>
  </tr>
  <tr>
    <td bgcolor="#042638">Verzeichnis w&auml;hlen </td>
    <td><input type="file" name="upload" /></td>
  </tr>
  <tr>
    <td bgcolor="#042638"></td>
    <td bgcolor="#042638"><label>
<input type="hidden" name="MAX_FILE_SIZE" value="60000000" />
      <input type="submit" name="submit" value="Upload" />
      <input type="hidden" name="exsist" value="haha" />
    </label></td>
  </tr>
</table>
</form>
</body>
</html>
 
beachte bitte das "/" in deinem fall das root directory des servers meint : )
du musst entweder einen relativen pfad benutzen ( "./upload/flash_tut/" ) oder einen absoluten vom wirklichen root dir ( vielleicht sowas wie "/var/www/lukeelten/content/upload/flash_tut" ) -
Code:
<?php
echo getcwd();
?>

sollte dir helfen.
 
Status
Für weitere Antworten geschlossen.
Zurück
Oben