View Single Post
Old 08-23-2013, 11:28 AM  
srockhard
Retired
 
srockhard's Avatar
 
Industry Role:
Join Date: Jul 2011
Location: PDXXX
Posts: 1,976
Need a Help with Form

My form works great but I can't get the user submitted images to save to my server or display in the email that I receive once form is submitted. What is wrong here:

Code:
    $allowed_extensions = array("jpg", "jpeg", "gif", "bmp", "png");

    //Get the uploaded file information

    $name_of_uploaded_file =  basename($_FILES['photo']['name']);

    //get the file extension of the file

    $type_of_uploaded_file = substr($name_of_uploaded_file, strrpos($name_of_uploaded_file, '.') + 1);

    $size_of_uploaded_file = $_FILES["photo"]["size"]/1024;//size in KBs     

     //copy the temp. uploaded file to uploads folder

    $path_of_uploaded_file = $_SERVER['DOCUMENT_ROOT'] .'/' . $name_of_uploaded_file;

    $tmp_path = $_FILES["photo"]["tmp_name"];

    if(is_uploaded_file($tmp_path))

    {

      if(!copy($tmp_path,$path_of_uploaded_file))

      {

        $errors .= '\n error while copying the uploaded file';

      }

    }
__________________
Piper Pines
srockhard is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook