Skip to content
Marek Fišera edited this page Feb 6, 2019 · 10 revisions

A simple file upload web app with cool features like drag and drop. Also with steps to host as a linux service. Features:

  • Multi file upload.
  • Async upload using AJAX.
  • Upload progress.
  • Drag & drop support.
  • Paste from clipboard support (not working when pasting from Windows File Explorer, not sure why).

Configuration

Section Upload:

  • Default - A default profile. Can be null, only named profiles are then used.
  • Profiles - As an extension to default profile, you can define any number of additional files. These are defined as key-value pairs where key is used as an URL slug; and value is "profile" configuration.

Section Profile:

  • MaxLength - A maximum size of upload file in bytes.
  • SupportedExtensions - An array of supported file extension (including '.').
  • StoragePath - A server path where upload files should be stored.
  • MaxStorageLength - A max storage folder size.
  • IsOverrideEnabled - A boolean switch if overriding existing files is enabled.
  • IsDownloadEnabled - A boolean switch if download of existing files is enabled.
  • IsBrowserEnabled - A boolean switch if file listing is enabled.
  • IsDeleteEnabled - A boolean switch if deleting existing file is enabled.
  • IsListed - A boolean switch if profile should be listed in user menu.
  • Roles - An array of string containing roles allowed to manipulate with the profile.
  • BackupTemplate - A file rename template used to backup file before overriding with a new one. See #17.
  • DateTimeFormat - A file modification date time format. See #31.

Section Authentication:

  • Accounts - An array of section Account.

Section Account:

  • username - An username.
  • password - An Sha256 hash computed as {username}.{password}.
  • roles - An array of roles assigned to the account. ...

Example:

{
    //...

    "Upload": {
        "Default": {
            "MaxLength": 500000, // 500KB
            "SupportedExtensions": [ ".png", ".zip", ".doc" ],
            "StoragePath": "C:/Temp/Upload",
            "IsOverrideEnabled":  true
        },
        "Profiles": {
            "images": {
                "MaxLength": 200000, // 200KB
                "SupportedExtensions": [ ".png", ".jpg", ".gif" ],
                "StoragePath": "C:/Temp/Upload/Images",
                "MaxStorageLength": 2000000 // 2MB
            },
            "sources": {
                "MaxLength": 100000, // 100KB
                "SupportedExtensions": [ ".cs", ".aspx", ".ascx" ],
                "StoragePath": "C:/Temp/Upload/Sources",
                "IsBrowserEnabled": true
            }
        }
    }

    //...
}

URLs:

  • ~/ - Default profile.
  • ~/images - 'Images' profile;
  • ~/sources - 'Sources' profile;
Clone this wiki locally