views:

35

answers:

2

Hi Friends,
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.

+1  A: 

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: http://stackoverflow.com/questions/496751/base64-encode-string-in-vbscript

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

Rob Stevenson-Leggett
But there is no answer for how to get the image in PHP.If you know the way please suggest me.
vinothkumar
@vinothkumar As the answer states, use an AJAX request. If you don't know what that is, google it.
meagar
+2  A: 

Impossible.
Due to obvious security reasons.

Col. Shrapnel
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
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