0

I know this question may be wrong one.Anyway I want to know is it possible or not?
I am using the VBscript as client side language and PHP as server side language.By using the VBscript I got a image from the scanner and that image is stored in local system.I want to move it to server without client choosing the file.
When the scan is completed I display the image in the Image tag using the VB script.The image displayed in form.If the user submit the form I want to store the image in server.So is it possible to upload a image using any method without client need to choose browse button?
Thanks in advance.

svk
  • 4,513
  • 18
  • 63
  • 100

2 Answers2

2

Impossible.
Due to obvious security reasons.

Your Common Sense
  • 156,878
  • 40
  • 214
  • 345
  • 2
    This - if the security reasons aren't obvious: if you were allowed to do this, sites could just grab any file from your filesystem and post it to their servers. User interaction is required. – MacAnthony Sep 14 '10 at 13:20
  • 1
    If he's already scanning an image from the computer and displaying it on a webpage using VBScript, he could use VBScript to POST to a URL. Thus bypassing the standard form submission all together. – Rob Stevenson-Leggett Sep 14 '10 at 19:06
1

I think you'd need to create a HTTP POST request with the image encoded as a base 64 string (which is sort of what happens when you post a form with an image upload). An AJAX request would be best I'm not sure whether you can do this with VBScript or not.

This question might help you: Base64 Encode String in VBScript

And this article http://www.bigresource.com/PHP-decoding-base64-into-an-image-EQvGWPIX.html

Community
  • 1
  • 1
Rob Stevenson-Leggett
  • 35,279
  • 21
  • 87
  • 141
  • But there is no answer for how to get the image in PHP.If you know the way please suggest me. – svk Sep 14 '10 at 12:11
  • @vinothkumar As the answer states, use an AJAX request. If you don't know what that is, google it. – user229044 Sep 14 '10 at 18:48