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 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.
expireUnit string never The expiration type for the paste. Possible values are view (Max number of Downloads) or a date value minute, hour, day, month, year
expireLength int 1 The length of whatever unit you choose before the paste is deleted.
genDeletionKey bool false Generates a deletion key.


{"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.
maxDownloads int The maximum number of uploads before the upload is deleted.
expirationDate datetime The date of expiration of the upload.
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.