Upload Service

This is a description of the API commands available for the Upload service.

Upload a File

POST https://api.teknik.io/v1/Upload


Name Value Default Value Description
Authorization Basic Encoding.Base64(<username>:<token>) NULL Basic Authentication to associate the upload with your account.


Name Type Default Description
file file NULL Required The file that you would like to upload.
contentType string no The content-type of the file you are uploading. Only required if the file being uploaded is already encrypted.
encrypt bool true If you want the file to be encrypted server side. This will regenerate the key and/or iv if none are passed in.
saveKey bool true Saves the passed in or generated key to the server. This will make it so that on download, the file will decrypt server side.
key string NULL If you want the file to be decrypted server side, include the key.
keySize int 256 The size of the key provided in bits. Only needed if encrypting and no key is provided.
iv string NULL If the file has been encrypted and you want it decrypted (Both Server and Client Side), include the iv.
blockSize int 128 The size of the iv provided in bits. Only needed if encrypting and no iv is provided.
genDeletionKey bool false Generates a deletion key.
doNotTrack bool false If you do not want the api request to be tracked as defined in the privacy policy.


{"result":{"url":"url", "fileName":"fileName", "contentType":"contentType", "contentLength":contentLength, "key":key, "keySize":keySize, "iv":iv, "blockSize":blockSize, "deletionKey":deletionKey}}
Name Type Description
url string The direct url to the uploaded file. The key is apended to the url as an anchor tag.
fileName string The filename of the uploaded file.
contentType string The MIME file type of the uploaded file.
contentLength integer The size of the uploaded file in bytes.
key string Optional The key that was used to encrypt the file.
keySize int The size of the key used in bits.
iv string Optional The iv that was used to encrypt the file.
blockSize int The size of the iv used in bits.
deletionKey string Optional The deletion key for file. Use it as follows: https://u.teknik.io/file.jpg/deletionKey


$ curl -F "genDeletionKey=true" -F "encrypt=true" -F "file=@image.png" https://api.teknik.io/v1/Upload

This will upload the file image.png, encrypt it, and then generate a deletion key.