Send an image to PHP webpage in vbs?

Viewed 31

So, basically, I'm trying to take a picture of my desktop, then send it to a webpage with PHP. Not sure how to do this, I've tried LoadImage & sending it via xHtml, but I couldn't load the image.

Current code:

Set serv = "https://localhost/screenshot.php"
Function CaptureScreenShot(ScreenshotPath )  
  'Generate Name of the Image 
  strimgFileName="Img\Img" & Day(Date)& Month(Date) & Year(Date) & Hour(Now) & Minute(Now) & Second(Now) &".jpg"  
  strImgFile= ScreenshotPath & strimgFileName   
  'Capture failure Screen shot 
  Set objPic = Sys.Desktop.Picture()  
  'Save captured Screen shot 
  ExecutionStatus = objPic.SaveToFile(strImgFile)  
  'Return Captured image name
  CaptureScreenShot=".\" & strimgFileName  
End Function   
Set httpreq = WScript.CreateObject("MSXML2.ServerXMLHTTP")
httpreq.Open "POST",  serv, false
httpreq.Send CaptureScreenShot("C:\Windows\record.png")
0 Answers
Related