What do you do for scanning from withing Filepro

Brian K. White brian at aljex.com
Wed Mar 29 13:32:05 PDT 2017


Here is a demo anyone can poke at, minus the filepro side, since you can 
only access this cgi, not log in to the server.

Install whichever one of these applies to you:
http://install.aljex.com/AljexClient/

Then load this:
http://oh7.aljex.com/cgi-bin/tsu?AKcZCKL96ENuIZhj7i6TB9UA5LYYNbeWx8VyPBSjNtqWj-dJ-aY.

It's a demo system, feel free to upload images and delete them.

See where it says "(invoice_public 73356)" ?

I generated this url by going into the app, into the invoice file, to 
invoice number 73356, and hit an @key which ran the gosub to assemble 
and fire off this url.

If you view source, you'll see that the scan button launches:
as:,oh7.aljex.com,AKcZCKL96ENuIZhj7i6TB9UA5LYYNbeWx8VyKQO7c5iPkO5L
which the browser hands off to the registered handler for that url, 
which is the batch or shell script.
And at the same time it reloads the same current cgi with a new query 
string. The new query string loads the very same page, but with an 
option that also tells the cgi to wait for the expected file to appear 
behind the scenes before completing the redraw, this way when the user 
scans, the web page updates to include the new scan as soon as it's done.

I think there is probably some slicker ajaxy way to get the web page to 
update and display the new scan after the user does a scan, but I'm not 
that sophisticated.

If you don't have a scanner, the client-side will use a built-in 
single-page pdf. It actually uploads the file the same way it would have 
if it were a real scan. So you can go through all the same motions with 
or without a scanner. It's useful for debugging to show if the user has 
a local firewall preventing the upload vs an actual scanner problem or 
some server-side problem.

-- 
bkw

On 3/29/2017 2:08 PM, Bob Rasmussen wrote:
> Brian, thanks for the explanation. How do the server and the client-side
> piece communicate, when no terminal emulator is involved? A socket?
>
> And how does the server know what the client's IP address is? Will this
> all fail if Network Address Translation sits between client and server?
>
> On Wed, 29 Mar 2017, Brian K. White via Filepro-list wrote:
>
>> On 3/23/2017 5:13 PM, Boaz Bezborodko via Filepro-list wrote:
>>> I'm  looking to scan in files linked to specific Filepro records. This
>>> is the first time I'm doing any kind of work like this.
>>>
>>> What methods do you folks use to accomplish this?
>>> What software/hardware combinations make it easier?
>>>
>>> I was thinking of creating separate documents, saved to specific
>>> directories, and storing the file names and locations in the record.
>>> But I don't know what software to use that could trigger the scan and
>>> specify the file name, directory, etc.
>>>
>>> I'm working with Filepro 5.6.10R9 running on Windows7 machines.
>>>
>>> Thanks,
>>> Boaz
>>>
>>
>> I feel bad, I think we have a pretty neat scanning system we've been
>> using for 15 years by now, but I just have not had *any* time the last
>> couple weeks to show it to you. We just instituted all developers
>> using git and not working as root. Not exactly a smooth and painless
>> transition ;)
>>
>> Anyway our scanning process is mostly a cgi that runs in the web
>> server on the same server with filepro, and a small client package (we
>> have windows and osx versions) that has a commandline scanning util,
>> which is run by os registry entries to recognize a custom url, and/or
>> a terminal emulator that has a "run-program" escape sequence feature.
>> You don't have to use the bundled terminal emulator, several other
>> terminal emulators have a similar feature, but the included one is
>> free and open source so no serial numbers or anything to worry about.
>> Just click-n-go.
>>
>> Images are displayed to the user via web browser, and uploaded to the
>> server via http-post, or by the user using a drag-n-drop area in the
>> browser.
>>
>> In filepro you just fire off the right url which pops up the browser
>> on the client to either display previous scans or allow uploading new
>> ones. For more streamlined user process, you can also invoke the
>> scan-and-upload directly from filepro in the terminal without popping
>> up the browser.
>>
>> The files are stored on the filesystem in a directory structure that
>> simply matches your applications natural filepro file structure. If
>> you have an invoice file, and one of the records in the invoice file
>> is invoice 236517, then the files for that invoice end up being stored
>> in a path like:
>> /pix/app-or-system-or-customer-name/invoice/23/65/17-###.pdf
>> where ## is 1 to 100, up to 100 files per customer-doctype-docnumber
>> triplex. The "docnumber" (invoice number in this case) is split up
>> into 2-byte chunks just to keep the filesystem fast by not having a
>> million files in any single directory.
>>
>> (in our case, we have multiple companies or customers using their own
>> datasets (qualifiers) in the same application. So to address a
>> document uniquely, you need 3 pieces of info, company, doctype (quote,
>> invoice, check, etc), docnumber (quote#, invoice#, check#, etc).
>>
>> The worst part is the cgi ksh script that does all the work is kind of
>> a big ugly monster by now after 15 years or so! But, it's still
>> ultimately just a ksh script. There are a few other bits and pieces in
>> total but it's pretty simple.
>>
>> You don't do much extra in filepro at all to add document imaging to
>> any screen in your app. You mostly just add a gosub to any input table
>> and edit 2 values at the top of the gosub for doctype and docnumber to
>> whatever makes sense for that screen in your app.
>>
>> I'd say go to aljex.com and sit in on a sales demo, which will cover
>> the scanning, and you can actually use it in the demo system yourself,
>> but I don't know how much uninteresting trucking logistics stuff you'd
>> have to suffer through to get to the scanning.
>>
>> The client-side code is not only free but open-source, except the
>> windows scanning util is a commercial product we purchased. There are
>> a few different similar utils that can be used for that. I do have a
>> very crude open source scanning util also, but it it is really really
>> crude. It only scans one page at a time, and only outputs a .bmp!
>> There are open source graphics libraries that could be added and used
>> to make a better scanner util, but I'm not a good enough c or windows
>> developer to manage it. The client-side code for osx is 100% open
>> source, including the scanning util, though the osx scanning util is
>> simple and doesn't work on a lot of scanners. Apparently scanner
>> drivers on osx are not consistent at all and many scanners come with
>> their own scanner programs and that is the only thing that works with
>> the scanner. But other scanners do support a common osx image capture
>> api, and those work. The server side, I guess you would have to talk
>> to our owner. I do have a crude proof-of-concept server-side script
>> that is shareable which takes in a scan and just displays it back. But
>> from there you can modify however you want. Even the crude script
>> collects the file and displays it. So just add code to that to do
>> something else with the file like save it in a directory structure of
>> your choice.
>>
>> --
>> bkw
>> _______________________________________________
>> Filepro-list mailing list
>> Filepro-list at lists.celestial.com
>> Subscribe/Unsubscribe/Subscription Changes
>> http://mailman.celestial.com/mailman/listinfo/filepro-list
>>
>
> Regards,
> ....Bob Rasmussen,   President,   Rasmussen Software, Inc.
>
> personal e-mail: ras at anzio.com
>  company e-mail: rsi at anzio.com
>           voice: (US) 503-624-0360 (9:00-6:00 Pacific Time)
>             fax: (US) 503-624-0760
>             web: http://www.anzio.com
>  street address: Rasmussen Software, Inc.
>                  10240 SW Nimbus, Suite L9
>                  Portland, OR  97223  USA
>



More information about the Filepro-list mailing list