title: upload image and store into my folder using jquery and php the below code procedure
body: <p>i am uploading image using this html code</p>
  
  <pre><code>&lt;div class="controls"&gt;
                      &lt;input title="Select the file." type="file" class="ar_pic" name="ar_pic" id="ar_pic"/&gt;
                  &lt;/div&gt;
  </code></pre>
  
  <p>i am not using form. i am sending value to locala.js the js code is</p>
  
  <pre><code> "Update": function() { 
                  var are_pic = $('#ar_pic').val(),
          imageNameIndex = are_pic.lastIndexOf('\\') + 1,
          area_pic = are_pic.substr(imageNameIndex); 
          $.post('LocalAUpdate.php',{
              user_id:id,area_pic:area_pic,action:'joined'
          });
  </code></pre>
  
  <p>and i tried using ajax but not working</p>
  
  <pre><code>$.ajax({
              type: "POST",
              url: "LocalAUpdate.php",
              enctype: 'multipart/form-data',
              data: {
                  user_id:id,evt_id:evt_id,are_nam:are_nam,are_des:are_des,area_pic:are_pic,action:'joined'
              },
              success: function () {
                  alert("Data Uploaded: ");
              }
          });
  </code></pre>
  
  <p>i am sending value to LocalAUpdate.php. the php code is given below</p>
  
  <pre><code>$fileName = $_FILES["area_pic"]["name"]; 
  $fileTmpLoc = $_FILES["area_pic"]["tmp_name"];
  $pathAndName = "uploads/".$fileName;
  // Run the move_uploaded_file() function here
  move_uploaded_file($fileTmpLoc, $pathAndName);
  
  if(isset($_POST['user_id'],$_POST['area_pic']))
          {
          $are_pic = $_POST['area_pic'];
          $action = $_POST['action'];
          if ($action=='joined')
                      {
              user_joined_update($user_id,$are_pic);
                  }
      }
  </code></pre>
  
  <p>i have created directory "uploads". but after click update button i cant see the image the directory is empty. i cant put die($fileName); or exit; php function it also not working. can u help me?</p>