In order to simplify the automated upload, we decided to create two utilities. These are winupload.pl and wincopy.pl. These programs are available as of 2010/IV Release in the /home/cvs/archivista/jobs folder. The two Perl programs are platform-independent. On Linux, Perl is probably already available, but not on Windows. For this reason, we have compiled the programs, i.e. you can use the programs as EXE files. The zipped versions can be found here:
www.archivista.ch/de/media/version/winupload.zip
and
www.archivista.ch/de/media/version/wincopy.zip
Using the first program (WinUpload), files can be uploaded easily. An entry with no parameters prints a short help text:
C:\avupload\winupload.exe v1.0 (c) 2010 by Archivista GmbH, upload files to webdms This program has three modes, a) single, b) config and c) upload a) single mode: C:\avupload\winupload.exe host db user password def https file [meta] b) config mode: C:\avupload\winupload.exe host db user password [def=0..x https=0/1] c) upload mode: C:\avupload\winupload.exe file [fieldname1=value1:fieldname2=value2..]
From this we can see that we can access WinUpload in three variants.
The file 'winupload.dat' is not available in plain text, but it must be stated that if you need high quality encryption, the present 1.0 version of WinUpload is not sufficient.
An upload via 'https' requires that the correct packages are present. This is currently not the case with WinUpload.exe. Therefore use WinUpload without HTTS, i.e. with the passing value '0' (corresponds to http access).
The following are the three modes, each with an example.
Before we can upload a file, we need to monitor a directory. This is what the second program (wincopy) is for. You can start the program without parameters and then receive a list of options.
C:\avupload\wincopy.exe v1.0 (c) 2010 by Archivista GmbH, watch a dir and call upload prg C:\avupload\wincopy.exe dirin dirtemp seconds (to wait between checks for uploads) [upload] => [upload] optional, without it call winupload.pl or winupload.exe => you can stop the program if you create a file wincopy.stp
Important! We strongly recommend that you only start the program within an empty application folder. If 'wincopy.exe' opens with a valid path, then all files will immediately be moved to a temporary directory and an attempt will then be made to upload the files.
But back to the parameters. The monitored directory must come first. This must be followed by a temporary directory in order to check whether a file to be uploaded is still 'locked' by an application In this case the upload cannot take place.
Third, a pause time can be entered in seconds (3 - 60). During this time, the directory indicated previously will be examined. Finally, here is a complete example:
Note: Item 7 only works if the file is no longer locked by the processing program. You will generally need to 'Save' or even 'Close' the file.
Of course you will want to open the 'wincopy.exe ' utility when booting or via a service. And of course you may want to adapt the Perl programs 'wincopy.pl' and 'winupload.pl' to fit your personal needs, i.e. if you want to place the source code under GPL license once again.