next up previous contents index


30.3.0.1 Solution with WinUpload or WinCopy

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.

  • In Single mode we enter all the parameters and the upload of the file occurs directly (without configuration).
  • In the Config mode we can enter the upload parameters so that we can then only specify the file name.
  • In Upload mode, finally, we only enter the file and any meta-information in order to upload a file. The connection options are read from the file 'winupload.dat'.

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.

Image tip 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.

  • Single-Modus: winupload 192.168.0.220 archivista Admin archivista 0 0 c: \14282d.pdf
  • Config-Modus: winupload 192.168.0.220 archivista Admin archivista 0 0
  • Upload-Modus: winupload 192.168.0.220 c: \14282d.pdf Text = Hallo

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

Image tip 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:

  1. Create a folder 'c:\avupload'
  2. Copy the 'winupload.exe' and 'wincopy.exe' files to this directory
  3. Start wincopy.exe 192.168.0.100 archivista Admin 0 0 (or other login options)
  4. Check the 'c:\avupload' directory to see whether the file 'winupload.dat' exists
  5. Verify that the 'c:\temp' directory exists (otherwise create it!)
  6. Start 'wincopy.exe. '(with the dot at the end you can start your current directory)
  7. Save an Office file in the 'c:\avupload' directory, and the file is then uploaded immediately.

Image tip 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.


next up previous contents index