title: how to upload file in php using the url alone without the html?
body: <pre><code>&lt;?php
  include_once 'dbconfig.php';
  ?&gt;
  &lt;form method="post" enctype="multipart/form-data"&gt;
  &lt;table width="350" border="0" cellpadding="1" cellspacing="1" class="box"&gt;
  &lt;tr&gt; 
  &lt;td width="246"&gt;
  &lt;input type="hidden" name="MAX_FILE_SIZE" value="2000000"&gt;
  &lt;input name="userfile" type="file" id="userfile"&gt; 
  &lt;/td&gt;
  &lt;td width="80"&gt;&lt;input name="upload" type="submit" class="box" id="upload" value=" Upload "&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;/table&gt;
  &lt;/form&gt;
  
  &lt;?php
  
  $fileName = $_FILES['userfile']['name'];
  $tmpName  = $_FILES['userfile']['tmp_name'];
  $fileSize = $_FILES['userfile']['size'];
  $fileType = $_FILES['userfile']['type'];
  
  $fp      = fopen($tmpName, 'r');
  $content = fread($fp, filesize($tmpName));
  $content = addslashes($content);
  fclose($fp);
  
  if(!get_magic_quotes_gpc())
  {
      $fileName = addslashes($fileName);
  }
  
  $query = "INSERT INTO upload (name, size, type, content ) ".
  "VALUES ('$fileName', '$fileSize', '$fileType', '$content')";
  
  mysql_query($query) or die('Error, query failed'); 
  include 'library/closedb.php';
  
  echo "&lt;br&gt;File $fileName uploaded&lt;br&gt;";
  
  ?&gt;
  </code></pre>
  
  <p>I'm a beginner in php</p>
  
  <p>I have a php file like this to upload a file into a database, but i don't need the html part. i have to give the file path directly to the php using the url is there a way to do it ?? . </p>
  
  <p>My exact problem is i need my C# program to communicate with the server to upload and download a file, I need to send it only using the URL so how can i send the actual path in url without need to type browse for the path in html</p>