filesize gibt fehler zurück

Einklappen
X
 
  • Filter
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge

  • Heavy
    antwortet
    zeile 70 ist

    $filesizebytes = filesize($images3);

    und wie man tags benutzt weis ich leider nicht

    $images3 enthält bei mir folgendes

    /home/www/web75/phptmp/phpwv3UI4

    also anscheinend die temporäre datei auf dem server.
    das sollte doch auch so richtig sein oder?
    Zuletzt geändert von Heavy; 15.02.2004, 15:19.

    Einen Kommentar schreiben:


  • wahsaga
    antwortet
    Re: filesize gibt fehler zurück

    Original geschrieben von Heavy
    PHP-Code:
                         $images "toupload$imCount"."_name";
                         
    $images1 = $$images;
                         
    $images2 "toupload$imCount";
                         
    $images3 = $$images2;
                         if(
    $images3 != "none") {
                             
    $filesizebytes filesize($images3); 
    ich tippe, dass $images3 nicht das gwwünschte enthält.

    kontrollausgabe ...?

    Einen Kommentar schreiben:


  • roNn
    antwortet
    Tobi, damit haste Recht allerdings ist ihm damit nicht geholfen.
    Die Bilder werden hochgeladen, da du nur eine WARNUNG bekommst und keinen FEHLER!

    Ausserdem kannst du doch sicher die Fehlermeldung lesen, oder? Kannst du Englisch? Na also..
    Es heißt einfach das PHP auf etwas in upload.php in der Nähe von Zeile 70 nicht zugreifen kann.. also zeig mal bitte Zeile 65 - 75 und benutze die PHP Tags!

    Einen Kommentar schreiben:


  • TobiaZ
    antwortet
    es kann nicht schaden die [PHP]-Tags des Forums zu nutzen.

    Einen Kommentar schreiben:


  • Heavy
    hat ein Thema erstellt filesize gibt fehler zurück.

    filesize gibt fehler zurück

    hallo,
    hab ein kleines upload script, das mir aber eine fehlermeldung zurückgibt.
    beim prüfen mit filesize bekomme ich die meldung:
    Warning: filesize() [function.filesize]: Unable to access in /home/www/web75/html/tourney/upload.php on line 70.

    irgend einen tipp?
    die dateien werden übrigends trotzdem auf den server hochgeladen.


    PHP-Code:
    <?php
    $config
    [files] = "3";                        //Number of FikeUploadBoxes
    $config[dir] = "../screenshots/";      //!!!!!This Folder has to be created as subfolder!!!!!!!!!!!!!!!
    $imagetype="gif";

      if (!
    is_dir("$config[dir]")) die ("Verzeichniss \"$config[dir]\" nicht gefunden.");

      
    $handle=opendir("$config[dir]/");
      while (
    $file readdir($handle))
      {
       if (
    $file=="." or $file=="..")
       {} else 
    $filelisting[]="$file";

       
    $imCountber=sizeof($filelisting);
      };
      
    $h 1;
    $g=0;

    for (
    $i $i $imCountber $i++)
    {
         
    $album[$i] = substr($filelisting[$i],0,strpos($filelisting[$i],"~"));
    }

    if (isset(
    $album))
    {
     
    sort($album);
     
    reset($album);
    }

    for (
    $i $i count($album) ; $i++)
    {
         
    $next $album[$i+1];
         if (
    $next != $album[$i])
         {
             
    $alben[$album[$i]] = $h;
             
    $h=1;
         }
         else 
    $h++;
    }

    if (
    $mode == "uploadfile") {
        for (
    $i $i count($album) ; $i++){
                     
    $next $album[$i+1];
                         if (
    $next != $album[$i]) {
                           
    $alben[$album[$i]] = $h;
                           
    $h=1;
                  } else {
    $h++;
                 }
                 }

                  
    $imCount 0;
                  if (isset(
    $alben[$aname]))
                      
    $h $alben[$aname] +1;
                  else 
    $h=1;
                  while(
    $imCount $config[files]) {
                         
    $imCount++;

                         
    $images "toupload$imCount"."_name";
                         
    $images1 = $$images;
                         
    $images2 "toupload$imCount";
                         
    $images3 = $$images2;
                         if(
    $images3 != "none") {
                             
    $filesizebytes filesize($images3);
                             
                            if (
    $filesizebytes ==0) {
                                 
    $error .= sprintf("Keine Datei ausgewählt<BR>"$images1);
                             }
                             elseif (
    $filesizebytes 500000) {
                                 
    $error .= sprintf("Datei %s zu gross (maximale Dateigrösse 0,5 Mb)<BR>"$images1);
                             }
                             
                            elseif (
    file_exists("$config[dir]/$aname~$h.$imagetype")) {
                                
    $error .= sprintf("Interner Fehler (%s exisitert bereits));
                             }
                             else {
                                copy (
    $images3, "$config[dir]/$aname~$h.$imagetype");
                                
    $error .= sprintf("Datei %s wurde als $aname~%s.$imagetype hochgeladen.<br>",$images1,$h);
                                
    $h++;
                                
    $DemoStrg= "screenshot.php?FixtureID=".$aname;
                                
    $UpdateScreenshotLink = "UPDATE fixture SET demolink '".$DemoStrg."' WHERE fixtureid '".$FixtureID."'";
                                sql_query(
    $UpdateScreenshotLink);
                             }
                         clearstatcache();
                         }
                   }

         echo("
    <h3>Upload Result</h3><br>$error\n");
         echo "
    <br><br>\n<a href=\"$PHP_SELF?FixtureID=$aname\">Zur&uuml;ck</a>\n";

          exit();
    }
         
    $imCount 0;
         while(
    $imCount $config[files]) {

           
    $imCount++;
           
    $html .= "<tr width=\"25%\"><th align=\"left\" >Screenshot $imCount</th><td width=\"75%\" class=\"list\" align=\"left\">
    <input name=\"toupload
    $imCount\" type=\"file\" size=\"25\" value=\"Durchsuchen\"></td>";
    }
    ?>
         <form enctype="multipart/form-data" action="upload.php?FixtureID=<?=FixtureID?>" method="post">
         <p>Screenshots als *.<?=$imagetype?> Datei 800x600 uploaden (maximale Dateigrösse 0,5 MB).</p>
         <input type="hidden" name="mode" value="uploadfile">
         <input type="hidden" name="aname" value="<?=$FixtureID?>">
         <table width="450" border="0" cellspacing="0" cellpadding="0">
            <tr><td width="100%">
               <table width="450" border="0" cellspacing="1" cellpadding="2">
                 <tr><th colspan="2">Select Files</th></tr>
                 <?php echo $html?>
         </table></td></tr>
         <tr><td align="center"><input type="submit" value="Upload Files"></td></tr>
         </table>
         </form>
         
    <?
    Zuletzt geändert von wahsaga; 15.02.2004, 14:17.
Lädt...
X