title: Uploading Text File via HTTP using vbscript
body: <p>I want to upload a text file from local drive to web server by HTTP using vbscript. How to do this?  I need to upload a .txt file into server . </p>
  
  <p>Vbscript code I used: </p>
  
  <pre><code>strUserID = "******" 
  strPassword = "******" 
  
    strURL =   "http://testpias.site50.net/http/up.php"
  
  Set HTTP = WScript.CreateObject("Microsoft.XMLHTTP")
  Set fso = CreateObject("Scripting.FileSystemObject")
  
  
  
  Set objStream = CreateObject("ADODB.Stream")
  objStream.Type = 1
  objStream.Open
  objStream.LoadFromFile "G:\Http\http.txt"
  
  
  
  
  HTTP.open "POST", strURL &amp; "http.txt", False , strUserID , strPassword
  WScript.Echo "Now uploading file " &amp; "G:\Http\http.txt"
  
  
  HTTP.send objStream.Read
  
  
   WScript.Echo "Uploading complete for file " &amp; fso.GetFileName(File)
  
  
  
  
  WScript.Echo "All files uploaded."
  
  Set HTTP = Nothing
  </code></pre>
  
  <p>PHP code I used to receive the file :</p>
  
  <pre><code>&lt;?php
  
          $file_path = "http/";
  
          $file_path = $file_path . basename( $_FILES['uploaded_file']['name']);
          if(move_uploaded_file($_FILES['uploaded_file']['tmp_name'], $file_path)) {
              echo "success";
          } else{
              echo "fail";
          }
       ?&gt;
  </code></pre>
  
  <p>But I got this  error while I ran the vbscript ,  " Access is denied " . </p>