Jump to content

Code to take photo from scanner immediately


omarh2005

Recommended Posts

If you have a local server, you can possibly use curl (not sure how they do on file upload forms) and use glob with copy and unlink to basically do this:

 

Scan images to a local folder "new_scanned" use Windows Tasks or a CRON job on Linux to run a local script on your local PHP server. You open the directory of the new_scanned images (using glob) read the file to the script then use that to construct POST data to the remote page form and send it that way using curl. Once it is completed, copy the image (if you want to) to an "old_scanned" directory and then unlink the image inside of the "new_scanned" directory.

 

Unsure if that is what you were after, but is about the only I could see doing it with PHP. That is if curl can send files to scripts I am not sure on that part.

You would have to have software on the computer that allows a commandline interface to send the commands to the scanner. This will also require the scanner drivers. As far as how to do that, I have no clue. You will have to look up how to utilize scanners by a command line interface on the operating system you are using.

 

This is not possible with PHP alone.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.