pic uploader

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

    pic uploader

    How to fix dis error? <br/><br/> -->

    file not uploaded to the wanted
    location
    Error: GD doesn't seem to be
    present
    «Back to Gallery
    Home
    Last edited by rayjee; 13.09.10, 04:19.


    http://www.toinx.org

    #2
    dont use gd.... show us ur script :P

    Comment


      #3
      Classupload

      Originally posted by something else View Post
      dont use gd.... show us ur script :P
      how to rem0ve that? And i found GD FUNCTI0N n the classUpload
      HERE

      /**
      * Returns the version of GD
      *
      * @access public
      * @return float GD version
      */
      function gd_version() {
      static $gd_version = null;
      if ($gd_version === null) {
      if (function_exists('gd_info')) {
      $gd = gd_info();
      $gd = $gd["GD Version"];
      $regex = "/([\d\.]+)/i";
      } else {
      ob_start();
      phpinfo(;
      $gd = ob_get_contents();
      ob_end_clean();
      $regex = "/\bgd\s+version\b[^\d\n\r]+?([\d\.]+)/i";
      }
      if (preg_match($regex, $gd, $m)) {
      $gd_version = (float) $m[1];
      } else {
      $gd_version = 0;
      }
      }
      return $gd_version;
      }

      dis is the problem or n0t?

      Added after 10 minutes:


      and dis s the
      UPLOAD.Php

      //////////////////////////////////Members List

      error_reporting(E_ALL);

      // we first include the upload class, as we will need it here to deal with the uploaded file

      $userinfo = mysql_fetch_array(mysql_query("SELECT name, sex FROM yggrassil_users WHERE id='".$uid."'"));
      $membername = $userinfo[0];

      // we have three forms on the test page, so we redirect accordingly
      if ($_POST['action'] == 'image') {

      $pid = $_POST["pid"];

      echo "<head>";
      echo "<title>Mobile Kawap</title>";
      echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">";
      echo "</head>";
      echo "<body>";
      echo "<p align=\"center\">";

      // ---------- IMAGE UPLOAD ----------

      // we create an instance of the class, giving as argument the PHP object
      // corresponding to the file field from the form
      // All the uploads are accessible from the PHP object $_FILES
      $handle = new Upload($_FILES['my_field']);

      // then we check if the file has been uploaded properly
      // in its *temporary* location in the server (often, it is /tmp)
      if ($handle->uploaded) {

      // yes, the file is on the server
      // below are some example settings which can be used if the uploaded file is an image.
      $handle->image_resize = true;
      $handle->image_ratio_y = true;
      $handle->image_x = 100;

      // now, we start the upload 'process'. That is, to copy the uploaded file
      // from its temporary location to the wanted location
      // It could be something like $handle->Process('/home/www/my_uploads/');
      $handle->Process('../pkfiles/');

      // we check if everything went OK
      if ($handle->processed) {
      // everything was fine !

      echo ' file uploaded with success<br/>';
      echo ' <img src="../pkfiles/' . $handle->file_dst_name . '" /><br/>';
      $info = getimagesize($handle->file_dst_pathname);
      echo ' upload successfully';
      $itemurl = "../pkfiles/$handle->file_dst_name";

      if($pid=="1")
      {
      $pid = 1;
      }else{
      $pid = 0;
      }

      $reg = mysql_query("INSERT INTO yggrassil_gallery SET uid='".$uid."', itemurl='".$itemurl."', sex='".$userinfo[1]."', time='".time()."', private='".$pid."'");

      } else {
      // one error occured

      echo ' file not uploaded to the wanted location<br/>';
      echo ' Error: ' . $handle->error . '<br/>';

      }

      // we delete the temporary files
      $handle-> Clean();

      } else {
      // if we're here, the upload file failed for some reasons
      // i.e. the server didn't receive the file

      echo ' file not uploaded on the server<br/>';
      echo ' Error: ' . $handle->error . '';
      }


      echo "</p>";
      ////// UNTILL HERE >>
      echo "<p align=\"center\">";
      echo "<br/><br/><a href=\"index.php?action=pkgal&amp;sid=$sid\">&#171 ;Back to Gallery</a><br/>";
      echo "<a href=\"index.php?action=main&amp;sid=$sid\">";
      echo "Home</a>";
      echo "</p>";


      echo "</body>";
      echo "</html>";
      exit();
      }
      ?>
      Last edited by rayjee; 12.09.10, 05:06.


      http://www.toinx.org

      Comment


        #4
        Originally posted by riderz
        just go and create ur folder pkfiles and chmod it to 777
        @rider i have already that folder. . im using a freehost b4 and my uploader is ok, but wen im switch n0w to paidhosting the uploader is n0t working? And al avatars and pkfiles turn to a box object only. And tamagotchi level images is n0t appear to0.. Why o why??


        http://www.toinx.org

        Comment


          #5
          You have no gd libary installed so you would either have to get it installed or make a work around like this:
          PHP Code:
          <?php

          error_reporting
          (E_ALL); 

          $userinfo mysql_fetch_array(mysql_query("SELECT name, sex FROM yggrassil_users WHERE id='".$uid."'"));
          $membername $userinfo[0];
          if (
          $_POST['action'] == 'image') {

          echo 
          "<head>";
          echo 
          "<title>Mobile Kawap</title>";
          echo 
          "<link rel=\"stylesheet\" type=\"text/css\" href=\"style.css\">";
          echo 
          "</head>";
          echo 
          "<body>";
          echo 
          "<p align=\"center\">";
          move_uploaded_file($_FILES['my_field']['tmp_name'] ,'../pkfiles/'.$_FILES['my_field']['name']);
          echo 
          ' file uploaded with success<br/>';
          echo 
          ' <img src="../pkfiles/' $_FILES['my_field']['name'] . '" /><br/>';
          if(
          $_POST["pid"]==1)
          {
          $pid 1;
          }else{
          $pid 0;
          }

          $reg mysql_query("INSERT INTO yggrassil_gallery SET uid='".$uid."', itemurl='../pkfiles/'".$_FILES['my_field']['name']."', sex='".$userinfo[1]."', time='".time()."', private='".$pid."'");


          echo 
          "</p>"
          ////// UNTILL HERE >> 
          echo "<p align=\"center\">";
          echo 
          "<br/><br/><a href=\"index.php?action=pkgal&amp;sid=$sid\">&#171 ;Back to Gallery</a><br/>";
          echo 
          "<a href=\"index.php?action=main&amp;sid=$sid\">";
          echo 
          "Home</a>";
          echo 
          "</p>";


          echo 
          "</body>";
          echo 
          "</html>";
          exit();
          }
          ?>
          this isnt a very secure uploader ^^^^ search for gallery uploaders on here there is plenty of them

          Comment


            #6
            search in google for GDlib compilation for your php.
            Nous Ne Dansos Pas, Nous Sommes Le Danse.!

            Comment


              #7
              Guys

              Tnx sumthing else and all, its to0 hard for a newbeast like me to add a new c0de like u post =( can u explain me why is n0t workin n0w my uploader in the paid hosting? . . Bcuz i use freehost b4 and its ok.. . N0w all in pkfiles folder and avatar folder and images turn all to "BOX OBJECT" ONLY . . Lol
              Last edited by rayjee; 13.09.10, 03:47.


              http://www.toinx.org

              Comment


                #8
                Gd library is for changing your pictures ... eg adding a watermark or resize or combining 2 pictures together to create 1 etc....
                you could try asking your host to install it.....
                im guessing on the free host it was already installed

                Comment


                  #9
                  Originally posted by rayjee View Post
                  Tnx sumthing else and all, its to0 hard for a newbeast like me to add a new c0de like u post =( can u explain me why is n0t workin n0w my uploader in the paid hosting? . . Bcuz i use freehost b4 and its ok.. . N0w all in pkfiles folder and avatar folder and images turn all to "BOX OBJECT" ONLY . . Lol
                  On your free host GD worked as because Your Free Host Provider Installed GD Library On Their Server. But It Seems Your Paid Host Provider Hasn't Install GD Library. Thats why You Can't Use GD.
                  In this Case You Can Contact With Your Host Provider to Install GD On thier Server. Or Don't Use GD.

                  Comment


                    #10
                    thanx

                    Tnx sumthin else and khan . I get it. . Uhm can i use and edit my smiley uploader to upload a picture? And redirect to pkfiles folder?? Or can u gave me a link here a secured photo uploader have a reziser?. . Thanks f0r your post reply =)


                    http://www.toinx.org

                    Comment

                    Working...
                    X