Sometings Wrong With My Upload Script

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

    Sometings Wrong With My Upload Script

    the jpeg upload works fine n my host also supports all these files then whats wrong
    Code:
    <?php
    
    if (($_FILES["file"]["type"] == "application/java")
    
    || ($_FILES["file"]["type"] == "application/java-archive")
    
    || ($_FILES["file"]["type"] == "text/vnd.sun.j2me.app-descriptor")
    
    || ($_FILES["file"]["type"] == "application/x-java-archive")
    
    || ($_FILES["file"]["type"] == "application/vnd.symbian.install")
    
    || ($_FILES["file"]["type"] == "image/jpeg")
    
    || ($_FILES["file"]["type"] == "image/pjpeg")
    
    && ($_FILES["file"]["size"] < 200000000000000))
    
      {
    
      if ($_FILES["file"]["error"] > 0)
    
        {
    
        echo "Return Code: " . $_FILES["file"]["error"] . "
    ";
    
    echo"[url="&#39;http://nahsorhseda.wen9.com/&#39;><img"][/url]
    ";
    
        }
    
      else
    
        {
    
        echo "Upload: " . $_FILES["file"]["name"] . "
    ";
    
        echo "Type: " . $_FILES["file"]["type"] . "
    ";
    
        echo "Size: " . ($_FILES["file"]["size"] / 1024) . " Kb
    ";
    
        echo "Temp file: " . $_FILES["file"]["tmp_name"] . "
    ";
    
        if (file_exists("wapbuddy/sis_apps/" . $_FILES["file"]["name"]))
    
          {
    
          echo $_FILES["file"]["name"] . " already exists. ";
    
    echo"[url="&#39;http://nahsorhseda.wen9.com/&#39;><img"][/url]
    ";
    
          }
    
        else
    
          {
    
          move_uploaded_file($_FILES["file"]["tmp_name"],
    
          "wapbuddy/sis_apps/" . $_FILES["file"]["name"]);
    
          echo "Stored in: " . "downloadmanager/sis_apps/" . $_FILES["file"]["name"];
    
          echo"[url="&#39;http://nahsorhseda.wen9.com/&#39;><img"][/url]
    ";
    
          }
    
        }
    
      }
    
    else
    
      {
    
      echo "Invalid file";
    
    echo"[url="&#39;http://nahsorhseda.wen9.com/&#39;><img"][/url]
    ";
    
      }
    
    ?>
    
    
    
     

    #2
    try my uploader

    Click here!!!

    Comment


      #3
      try my uploader[/b]
      can you please give a download link

      Comment


        #4
        the jpeg upload works fine n my host also supports all these files then whats wrong
        Code:
        <?php
        
        if (($_FILES["file"]["type"] == "application/java")
        
        || ($_FILES["file"]["type"] == "application/java-archive")
        
        || ($_FILES["file"]["type"] == "text/vnd.sun.j2me.app-descriptor")
        
        || ($_FILES["file"]["type"] == "application/x-java-archive")
        
        || ($_FILES["file"]["type"] == "application/vnd.symbian.install")
        
        || ($_FILES["file"]["type"] == "image/jpeg")
        
        || ($_FILES["file"]["type"] == "image/pjpeg")
        
        && ($_FILES["file"]["size"] < 200000000000000))
        
          {
        
          if ($_FILES["file"]["error"] > 0)
        
            {
        
            echo "Return Code: " . $_FILES["file"]["error"] . "
        ";
        
        echo"[url="&#39;http://nahsorhseda.wen9.com/&#39;><img"][/url]
        ";
        
            }
        
          else
        
            {
        
            echo "Upload: " . $_FILES["file"]["name"] . "
        ";
        
            echo "Type: " . $_FILES["file"]["type"] . "
        ";
        
            echo "Size: " . ($_FILES["file"]["size"] / 1024) . " Kb
        ";
        
            echo "Temp file: " . $_FILES["file"]["tmp_name"] . "
        ";
        
            if (file_exists("wapbuddy/sis_apps/" . $_FILES["file"]["name"]))
        
              {
        
              echo $_FILES["file"]["name"] . " already exists. ";
        
        echo"[url="&#39;http://nahsorhseda.wen9.com/&#39;><img"][/url]
        ";
        
              }
        
            else
        
              {
        
              move_uploaded_file($_FILES["file"]["tmp_name"],
        
              "wapbuddy/sis_apps/" . $_FILES["file"]["name"]);
        
              echo "Stored in: " . "downloadmanager/sis_apps/" . $_FILES["file"]["name"];
        
              echo"[url="&#39;http://nahsorhseda.wen9.com/&#39;><img"][/url]
        ";
        
              }
        
            }
        
          }
        
        else
        
          {
        
          echo "Invalid file";
        
        echo"[url="&#39;http://nahsorhseda.wen9.com/&#39;><img"][/url]
        ";
        
          }
        
        ?>
         
        [/b]
        i think you need the mime magic mod to let it work
        Advertise your mobile site for FREE with AdTwirl

        Comment


          #5
          can you please give a download link[/b]
          http://www.2wap.org/forums/Recoding-Tommie...ript-t3618.html
          Advertise your mobile site for FREE with AdTwirl

          Comment


            #6
            Thanx m8, lol forgot bout this topic to help the guy out

            Click here!!!

            Comment


              #7
              <span style='font-family: "Times New Roman"'>ya but i tryin to make my own scripts , u see iam beginner at php if i just star
               usin someone elses  scripts ,i wont learn ,
              one can learn only from his mistakes ,i ll appreciate if u just find whats the mistake with the script


              and thanks in advance
              </span>

              Comment


                #8
                <span style='font-family: "Times New Roman"'>ya but i tryin to make my own scripts , u see iam beginner at php if i just star
                 usin someone elses  scripts ,i wont learn ,
                one can learn only from his mistakes ,i ll appreciate if u just find whats the mistake with the script


                and thanks in advance
                </span>[/b]

                Comment


                  #9
                  <span style='font-family: "Times New Roman"'>ya but i tryin to make my own scripts , u see iam beginner at php if i just star
                   usin someone elses  scripts ,i wont learn ,
                  one can learn only from his mistakes ,i ll appreciate if u just find whats the mistake with the script
                  and thanks in advance
                  </span>[/b]
                  you her gums, you need mime magic module, it is turned off on many servers...

                  Comment


                    #10
                    you her gums, you need mime magic module, it is turned off on many servers...[/b]
                    how do i turn it on ,i use cpanel hosting n they allow me to add mime types .if possible please tell me how to turn it on

                    Comment

                    Working...
                    X