title: Upload large File upto 100MB using php
body: <p>I am making a file hosting website like web hosting sites (megaupload, rapidshare, mediafire etc.) using PHP (or tell me if its easy to implement in ASP.NET).</p>
  
  <p>Project is almost complete but uploading module is not working correctly. I Google it but couldn't find any help so thought to ask here if anybody can help.</p>
  
  <p>Whenever I try to upload a file of size in kb, the script execute well and upload file but when I select a file of size greater than 1MB, it gives error message during upload, can anybody help me how can I upload file using HTTP protocols in PHP.</p>
  
  <p>Here is my script for upload:</p>
  
  <pre><code>// Configuration - Your Options
  
  $allowed_filetypes = array('.jpg','.gif','.bmp','.png'); 
  $filename = $_FILES['userfile']['name'];
  $ext = substr($filename, strpos($filename,'.'), strlen($filename)-1);
   if(!in_array($ext,$allowed_filetypes))
   die('The file you attempted to upload is not allowed.');
   if(filesize($_FILES['userfile']['tmp_name']) &gt; $max_filesize)
    die('The file you attempted to upload is too large.');
   if(!is_writable($upload_path))
    die('You cannot upload to the specified directory, please CHMOD it to 777.');
   if(move_uploaded_file($_FILES['userfile']['tmp_name'],$upload_path . $filename))
       echo 'Your file upload was successful, view the file &lt;a href="' . $upload_path . $filename . '" title="Your File"&gt;here&lt;/a&gt;'; 
   else
       echo 'Error during uploading.';  
  </code></pre>