Problem With Upload Script

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

    Problem With Upload Script

    firstly i created a simple upload script called upload.php, with the following code
    Code:
    <html>
    <head>
    <title>File Upload Form</title>
    </head>
    <body>
    This form allows you to upload a file to the server.
    
    
    <form action="getfile.php" method="post">
    
    Type (or select) Filename: <input type="file" name="uploadFile">
    <input type="hidden" name="MAX_FILE_SIZE" value="25000" />
    <input type="submit" value="Upload File">
    </form>
    
    </body>
    </html>
    then i created a getfile script called getfile.php, with following code
    Code:
    <html>
    <head>
    <title>Process Uploaded File</title>
    </head>
    <body>
    <?php
    
    if ( move_uploaded_file ($_FILES[&#39;uploadFile&#39;] [&#39;tmp_name&#39;], 
           "../uploads/{$_FILES[&#39;uploadFile&#39;] [&#39;name&#39;]}")  )
          {  print &#39;
    
     The file has been successfully uploaded </p>&#39;;
           }
    else
          { 
            switch ($_FILES[&#39;uploadFile&#39;] [&#39;error&#39;])
             {  case 1:
                       print &#39;
    
     The file is bigger than this PHP installation allows</p>&#39;;
                       break;
                case 2:
                       print &#39;
    
     The file is bigger than this form allows</p>&#39;;
                       break;
                case 3:
                       print &#39;
    
     Only part of the file was uploaded</p>&#39;;
                       break;
                case 4:
                       print &#39;
    
     No file was uploaded</p>&#39;;
                       break;
             }
           }
    
    ?>
    </body>
    </html>

    nothing happens, i tested it and nothing uploads!!!! whats the problem?

    #2
    did u chmod 777 the upload directory?

    Comment


      #3
      just did it, still nothing

      Comment


        #4
        ok check for yourself goto www.synergyx.co.za/upload/

        Comment


          #5
          k i see lol getfile.php just shows blank. its like a chat script i have. when you register it just shows blank page

          Comment


            #6
            k i see lol getfile.php just shows blank. its like a chat script i have. when you register it just shows blank page[/b]
            yes it shows blank and no file is uploaded

            Comment


              #7
              yes it shows blank and no file is uploaded[/b]
              Maybe try register globals on

              Comment


                #8
                Maybe try register globals on[/b]
                ok i know im asking again, but where do i find that

                Comment


                  #9
                  make file called php.ini

                  paste this in it
                  Code:
                  register_globals = On

                  Comment


                    #10
                    make file called php.ini

                    paste this in it
                    Code:
                    register_globals = On
                    [/b]
                    ok, where do i upload the file, in my main directory?

                    Comment


                      #11
                      yeah where upload.php is

                      Comment


                        #12
                        yeah where upload.php is[/b]
                        i just did and tried to upload and still get nothing

                        Comment


                          #13
                          Maybe your host has it turned off. i know mine does

                          Comment


                            #14
                            Maybe your host has it turned off. i know mine does[/b]
                            ill find out if he has it turned off quick

                            Comment


                              #15
                              Instead of making php.ini you can make .htaccess.
                              Ask your host to enable changing php values via .htaccess

                              ---------------------------
                              Thanks wappy for teaching me that lol

                              Comment

                              Working...
                              X