8.1.3.1. Process a file

Scanning a file using a specified workflow.

Scan is done asynchronously and each scan request is tracked by data id of which result can be retrieved by API 8.1.3.2. Fetch processing result.

Chunked transfer encoding (applying header Transfer-Encoding: Chunked) is not supported on /file API.

Request

Value

Method

POST

URL

/file

Request HTTP header parameters:

name

type

required

value

filename

string

false

name of file

filepath

string

false

if local file scan is enabled the path to the file (see Security rule configuration)

user_agent

string

false

client identification string

rule

string

false

name of the selected rule (see 8.1.3.5. Fetching available processing rules)

workflow

string

false

name of the selected workflow, deprecated

archivepwd

string

false

password for archive

Request body should contain the the content to be scanned.

Successful response

HTTP status code: 200

{
"data_id": "61dffeaa728844adbf49eb090e4ece0e"
}

Error response

Internal error

HTTP status code: 500

{
"err": "Failed to request scan. Try again later."
}

Scan queue is full

HTTP status code: 503

{
"err": "Server is too busy. Try again later."
}

Unexpected event on server

HTTP status code: 500

{
"err": "<error message>"
}

Note: Check Metadefender Core server logs for more information.