1. ProTop Knowledge Base
  2. Web Portal Administration

File Upload

You can review files describing a system on the ProTop Portal without logging in to the database server or executing any special commands.

The most commonly needed files include dbanalys, structure files, parameter files, property files, and related reports from ProTop.

This feature can automatically upload dbanalys and associated reports whenever ProTop detects new reports have been run, provided they are "allowed." Other files can be manually uploaded according to the rules set out below.

How to manually upload files

You can upload any file using the sendfile script:

sendfile[.sh] <fileName> [resource]

The filename must be explicit or relative to $PROTOP. A resource is optional. The file name must match an allowed pattern in an etc/upload.*.cfg file. The script can be called from local scripts to upload files that are not otherwise automatically uploaded.

Configuration

The rules in the etc/upload.*.cfg files restrict what bin/sendfile.sh[.bat] can upload. 

Here is the default etc/upload.cfg:


# upload.cfg
#
# the fullpath file name is compared to the pattern in field1
#   - UNIX file separators are REQUIRED - IOW: use "/", do NOT use "\"
#   - the pattern is evaluated using: filename MATCHES pattern
#   - MATCHES supports * (any group of characters, including null) and . (any single character) wild cards 
#   - if you want a literal * or . you must use a ~ escape
#   - these comparisons are NOT case-sensitive
#   - see the 4gl documentation for more details 
#
# if more than one line qualifies the LAST entry will be used
#

* deny                          # deny everything by default

# always end config files with a comment

The default configuration line, * deny, prevents the upload of any file. 

Make Local Versions

As with all ProTop configuration files, the default upload.cfg will be overwritten by future updates of ProTop. So, if you intend to use the file upload feature in a mode other than " *deny " (deny everything), at the very least, create an etc/upload.[custid].cfg.

NOTE: Unlike older cfg file processing, the upload*.cfg files are *additive*. Rather than only loading the most specific cfg file, we load them *all* from the most general (the template) to the most specific (upload.resource.cfg) and accumulate all the rules. This means you do not need to restate the template and can reuse default settings much more easily.

Example:

To allow the manual upload of any log file, for instance, the log/dbmonitor.log file, first copy etc/upload.cfg to etc/upload.custId.cfg. 

Now replace * deny with a pattern that you want to allow, followed by the "allow" rule so the active line looks like this:

*.log allow

NOTE: If more than one line qualifies the LAST entry will be used.

As the rules are additive, starting with the default, the existing upload config files, upload.cfg, and upload.custId.cfg, allow any file ending *.log and no others (* deny from the default upload.cfg) to be uploaded to the ProTop Portal.

Here are the possible upload.*.cfg file names and the order in which the etc/upload.*.cfg files are added:

  1. blank (the default, upload.cfg). This file, alone, prevents sendfile.sh from pushing any file to the ProTop Portal.
  2. custId (i.e. upload.custId.cfg)
  3. hostname (i.e. upload.server1.cfg)
  4. resource type (i.e. upload.db.cfg; this corresponds to the type/group column in dblist.cfg)
  5. custid + resource type (i.e. upload.custId.db.cfg)
  6. hostname + resource type (i.e. upload.hostname.db.cfg)
  7. friendly name (i.e. upload.sports.cfg)

How to see and manage uploaded files on the ProTop Portal:

  1. Log on to your ProTop Portal.
  2. Click the file upload icon in the left side menu: 
  3. You'll be presented with the Files screen:
  4. Filter on file properties using the fields at the top of each column
  5. Click the pencil button to edit the retention days, description, and type
  6. Click the trash can button to delete
  7. Click the eye button to view the file
  8. Click the download button to save a copy
  9. To multi-delete, click the checkbox at the left end of the line for each file you want to delete together and click the Delete Selected Files button at the top left of the screen