next up previous contents index



30.3 Automated upload

For uploading a file the following options are available:

  1. Upload of the revised file via WebDMS
  2. Upload via SMB/FTP folder (/office/dbname)
  3. Upload via API interface

This last option is very powerful, but requires a small script (as shown in this example with our main language, Perl).

#!/usr/bin/perl
my $ fout = shift; # get here the filename
use strict;
use LWP::UserAgent; # we work with UserAgent (our batch web browser)
use HTTP::Request::Common qw(POST); # the post method must be imported
my $server = "http://192.168.0.220/perl/avclient/index.pl";
my $www = LWP::UserAgent->new; # new www session
my $res = $www->request(POST "$server",
  Content_Type => 'form-data', # multipart/form-data
  Content => [ # structure for our file
  MAX_FILE_SIZE => 134217728, # max. size (webdms won't accept more)
  upload => [ $fout, $fout ], # file to upload, file name to use
  go => 'go_action', # we need to call the go_action command
  action => 'upload', # inside of go_action we need to use upload
  uploaddef => 0, # scan def
  host => 'localhost', # connection information
  db => 'archivista',
  uid => 'Admin',
  pwd => 'archivista',
  frm_Laufnummer => 1,
])

These lines of code upload a file to WebDMS via our API. Since these are HTTP requests, any programming language can be used for the upload itself.



Subsections
    • 30.3.0.1 Solution with WinUpload or WinCopy