Mein Uploadscript

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Mein Uploadscript

    Hallo,
    ich hab einen eigenen Uploadscript programmiert. Nur leider macht dieser bei Datein ab 10MB probleme und läd sie nicht mehr hoch.
    Hier mal ein Auszug:

    PHP Code:
    if($action == "add")
    {
        
    $userfile $_FILES["userfile"];

        if(
    $userfile)
        {
        
    $wala 1;
        while(
    file_exists("data/".$userfile["name"]))
        {
        
    $wala $wala 1;
        
    $userfile["name"] = $wala.$userfile["name"];
        }
        
    $filename $userfile["name"];
                if(
    move_uploaded_file ($_FILES['userfile']['tmp_name'], $ordner."/".$userfile['name']))
                {    
            echo
    'Die Datei <font color="#8c1212">
    <i>'
    .$userfile["name"].'</i></font> wurde 
    erfolgreich Hochgeladen. Unter folgender Adresse ist sie zu 
    erreichen:<br><br><a href="'
    .$ordner.'/'.$filename.'" 
    target="_blank">'
    .$pfad.'/'.$ordner.'/'.$filename.'</a><br><br>';
            }
            else
            {
            echo
    'Fehler beim Upload. Bitte versuchen Sie es erneut.';
            }

        }



    Ich hoffe, dass ihr mir helfen könnt.
    www.linex-design.de - design your world

  • #2
    php.ini
    upload_max_filesize
    max_execition_time
    memory_limit

    z.b.

    gruß
    peter
    Nukular, das Wort ist N-u-k-u-l-a-r (Homer Simpson)
    Meine Seite

    Comment


    • #3
      Ich habe das alles überprüft und geändert, aber der Script will immernoch nicht so, wie er soll. Er läd ein paar Minuten und dann kommt wieder die ganz normale Uploadseite (ohne irgendwelche Meldungen).

      Auszug aus /etc/php4/apache2/php.ini:
      PHP Code:
      ;;;;;;;;;;;;;;;;
      File Uploads ;
      ;;;;;;;;;;;;;;;;

      Whether to allow HTTP file uploads.
      file_uploads On

      Temporary directory for HTTP uploaded files (will use system default if not
      specified).
      ;
      upload_tmp_dir =

      Maximum allowed size for uploaded files.
      upload_max_filesize 1024M


      ;;;;;;;;;;;;;;;;;;;
      Resource Limits ;
      ;;;;;;;;;;;;;;;;;;;

      max_execution_time 1800     Maximum execution time of each scriptin seconds
      max_input_time 
      1800 Maximum amount of time each script may spend parsing request data
      memory_limit 
      1024M      Maximum amount of memory a script may consume (8MB
      ./apache restart wurde auch schon durchgeführt.

      Ich weis keinen Rat...
      Last edited by Campbell; 10-04-2008, 15:55.
      www.linex-design.de - design your world

      Comment


      • #4
        error_reporting hochgedreht? was sagt
        PHP Code:
        print_r($_FILES); 
        peter
        Nukular, das Wort ist N-u-k-u-l-a-r (Homer Simpson)
        Meine Seite

        Comment


        • #5
          Hast du im Formular ev ein hidden-Tag zur Grössenbeschränkung?
          Gutes Tutorial | PHP Manual | MySql Manual | PHP FAQ | Apache | Suchfunktion für eigene Seiten

          [color=red]"An error does not become truth by reason of multiplied propagation, nor does truth become error because nobody sees it."[/color]
          Mohandas Karamchand Gandhi (Mahatma Gandhi) (Source)

          Comment


          • #6
            print_r($_FILES); sagt mir, dass es ein leeres Array sei.
            PHP Code:
            Array ( ) 
            Im Formular hab ich eigentlich nichts zur Größenbeschränkung:
            PHP Code:
            <form enctype="multipart/form-data" action="index.php?option=upload&action=add" method="post">
            <
            table cellspacing="0" cellpadding="0" border="0">
            <
            tr>
            <
            td colspan="2">
            Bitte wählen Sie Ihre gewünschte Datei für den Upload aus.<br>
            Klicken Sie auf Durchsuchen oder geben Sie den Dateipfad manuell ein.<br><br>
            </
            td>
            </
            tr>
            <
            tr>
            <
            td width="100" height="30" valign="middle">
            Datei:
            </
            td>
            <
            td valign="middle">
            <
            input name="userfile" type="file">
            </
            td>
            </
            tr>
            <
            tr>
            <
            td>
            </
            td>
            <
            td>
            <
            input type="submit" value="Hochladen">
            </
            td>
            </
            tr>
            </
            table>
            </
            form
            Last edited by Campbell; 10-04-2008, 17:06.
            www.linex-design.de - design your world

            Comment


            • #7
              Hab das Problem gelöst. Wusste nicht, dass es in der php.ini euch noch die Einstellung
              PHP Code:
              post_max_size 
              gibt.
              Hatte dieses auf 8MB, jetzt läuft alles super.
              Danke für eure Bemühungen.
              www.linex-design.de - design your world

              Comment

              Working...
              X