Accepting Files

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

    Accepting Files

    Who have the code to accept any files that get uploaded to site

    when ppl upload pictures or downloads it must send a request for the owners to accept the incomming file
    ________________
    Jacques
    jacques@gw-designs.co.za
    http://coding.biz.tm
    Come join and lets make it a place to learn all the noobies how to code
    __________________

    NEVER FORGET TO CLICK THE TANX BUTTON IF U LIKE WHAT IM SHARING OR HELPING WITH

    #2
    Use the vaildate rule... get it from a lava script

    Comment


      #3
      yup i coded this for my site, iv got a row called approved in the gallery table, when they upload it its set to default as 0, but when you validated it you set it to 1.

      remember when you want to see the pic make sure u have it like WHERE approved = 1 so that it will only show images that hav been approved. this also helps to cut down on phpthumb memory, as you only have thumbs when you validate the picture onces its passed validation you dont need to place thumbs to view it....
      Want something coded email me at sales@webnwaphost.com for a prices.




      Comment


        #4
        so can staff view the file that get uploaded before validate it?
        ________________
        Jacques
        jacques@gw-designs.co.za
        http://coding.biz.tm
        Come join and lets make it a place to learn all the noobies how to code
        __________________

        NEVER FORGET TO CLICK THE TANX BUTTON IF U LIKE WHAT IM SHARING OR HELPING WITH

        Comment


          #5
          riderz, as crazybrumi said, WHERE approved = 0 is going to show you the non approved file. Then, and update to the table of downloads SET approved='1' WHERE id='$fileid' should work to Approve it.
          mysterio.al - programming is a functional art

          Comment


            #6
            Originally posted by riderz View Post
            Who have the code to accept any files that get uploaded to site

            when ppl upload pictures or downloads it must send a request for the owners to accept the incomming file
            very good idea

            Comment


              #7
              Or even better. Create a secure up loader. All my sites has one which I coded myself.

              Comment


                #8
                why not share one then
                ________________
                Jacques
                jacques@gw-designs.co.za
                http://coding.biz.tm
                Come join and lets make it a place to learn all the noobies how to code
                __________________

                NEVER FORGET TO CLICK THE TANX BUTTON IF U LIKE WHAT IM SHARING OR HELPING WITH

                Comment


                  #9
                  Originally posted by riderz View Post
                  why not share one then
                  if ($Submit){
                  if ($_FILES['image']['name']==''){
                  $error_msg = 'Please select a file';
                  $error = 1;
                  }

                  if (!$error){
                  $uploaddir = 'userimages/';
                  $file_name = rand(1,999).$_FILES['image']['name'];

                  if ($_FILES['image']['size'] >= 30721) {
                  $error_msg = "Your file is larger than 30KB.";
                  $upload_error = 1;
                  }
                  $file_type = "image";
                  $image_type = $_FILES['image']['type'];
                  $pos = strpos($image_type, $file_type);

                  if ($pos === false) {
                  $error_msg = "You cannot upload files of this type";
                  $upload_error = 1;
                  }

                  $file_info = getimagesize($_FILES['image']['tmp_name']);

                  if(empty($file_info)) {
                  $error_msg = "The uploaded file doesn't seem to be an image.";
                  $upload_error = 1;
                  }

                  if (!$upload_error) {
                  move_uploaded_file($_FILES['image']['tmp_name'], $uploaddir.$file_name);
                  // YOUR MYSQL QUERY GOES HERE
                  if ($res) $error_msg = "Your file was uploaded sucessfully";
                  else $error_msg = "Error occured, please try again";
                  }
                  }
                  }


                  That is just a simple uploader to make sure that only images is uploaded. You can go further and allow all file types but then hide the upload directory and or make files only down loadable. I do both.

                  If anyone want the any file type up loader with the only down loadable script, make me an offer. I am running a business after all.

                  PS : The script above is only the upload part and does not include the HTML/XHTML Form

                  Comment

                  Working...
                  X