123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331 |
- @model Teknik.Areas.Help.ViewModels.HelpViewModel
-
- <bundle src="css/help.min.css" append-version="true"></bundle>
-
- <div class="container">
- <ol class="breadcrumb">
- <li><a href="@Url.SubRouteUrl("help", "Help.Index")">Help Index</a></li>
- <li><a href="@Url.SubRouteUrl("help", "Help.API", new { version = string.Empty, service = string.Empty })">API</a></li>
- <li>v1</li>
- <li class="active"><a href="#">Upload Service</a></li>
- </ol>
- <div class="row api">
- <h2><b>Upload Service</b></h2>
- <hr>
- <p>This is a description of the API commands available for the Upload service.</p>
- <h3>Upload a File</h3>
- <pre><code>POST @Url.SubRouteUrl("api", "API.v1.Upload")</code></pre>
- <h4>Parameters</h4>
- <table>
- <thead>
- <tr>
- <th>Name</th>
- <th>Type</th>
- <th>Default</th>
- <th>Description</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td>
- <code>file</code>
- </td>
- <td>
- <code>file</code>
- </td>
- <td>
- <var>NULL</var>
- </td>
- <td>
- <strong>Required</strong>
- The file that you would like to upload.
- </td>
- </tr>
- <tr>
- <td>
- <code>contentType</code>
- </td>
- <td>
- <code>string</code>
- </td>
- <td>
- <var>no</var>
- </td>
- <td>
- The content-type of the file you are uploading. Only required if the file being uploaded is already encrypted.
- </td>
- </tr>
- <tr>
- <td>
- <code>encrypt</code>
- </td>
- <td>
- <code>bool</code>
- </td>
- <td>
- <var>true</var>
- </td>
- <td>
- If you want the file to be encrypted server side. This will regenerate the key and/or iv if none are passed in.
- </td>
- </tr>
- <tr>
- <td>
- <code>saveKey</code>
- </td>
- <td>
- <code>bool</code>
- </td>
- <td>
- <var>true</var>
- </td>
- <td>
- Saves the passed in or generated key to the server. This will make it so that on download, the file will decrypt server side.
- </td>
- </tr>
- <tr>
- <td>
- <code>key</code>
- </td>
- <td>
- <code>string</code>
- </td>
- <td>
- <var>NULL</var>
- </td>
- <td>
- If you want the file to be decrypted server side, include the key.
- </td>
- </tr>
- <tr>
- <td>
- <code>keySize</code>
- </td>
- <td>
- <code>int</code>
- </td>
- <td>
- <var>@Config.UploadConfig.KeySize</var>
- </td>
- <td>
- The size of the key provided in bits. Only needed if encrypting and no key is provided.
- </td>
- </tr>
- <tr>
- <td>
- <code>iv</code>
- </td>
- <td>
- <code>string</code>
- </td>
- <td>
- <var>NULL</var>
- </td>
- <td>
- If the file has been encrypted and you want it decrypted (Both Server and Client Side), include the iv.
- </td>
- </tr>
- <tr>
- <td>
- <code>blockSize</code>
- </td>
- <td>
- <code>int</code>
- </td>
- <td>
- <var>@Config.UploadConfig.BlockSize</var>
- </td>
- <td>
- The size of the iv provided in bits. Only needed if encrypting and no iv is provided.
- </td>
- </tr>
- <tr>
- <td>
- <code>expireUnit</code>
- </td>
- <td>
- <code>string</code>
- </td>
- <td>
- <var>never</var>
- </td>
- <td>
- The expiration type for the paste. Possible values are <code>view</code> (Max number of Downloads) or a date value <code>minute</code>, <code>hour</code>, <code>day</code>, <code>month</code>, <code>year</code>
- </td>
- </tr>
- <tr>
- <td>
- <code>expireLength</code>
- </td>
- <td>
- <code>int</code>
- </td>
- <td>
- <var>1</var>
- </td>
- <td>
- The length of whatever unit you choose before the paste is deleted.
- </td>
- </tr>
- <tr>
- <td>
- <code>genDeletionKey</code>
- </td>
- <td>
- <code>bool</code>
- </td>
- <td>
- <var>false</var>
- </td>
- <td>
- Generates a deletion key.
- </td>
- </tr>
- </tbody>
- </table>
- <h4>Response</h4>
- <pre><code>{"result":{"url":"<var>url</var>", "fileName":"<var>fileName</var>", "contentType":"<var>contentType</var>", "contentLength":<var>contentLength</var>, "key":<var>key</var>, "keySize":<var>keySize</var>, "iv":<var>iv</var>, "blockSize":<var>blockSize</var>, "deletionKey":<var>deletionKey</var>}}</code></pre>
- <table>
- <thead>
- <tr>
- <th>Name</th>
- <th>Type</th>
- <th>Description</th>
- </tr>
- </thead>
- <tbody>
- <tr>
- <td>
- <code>url</code>
- </td>
- <td>
- <code>string</code>
- </td>
- <td>
- The direct url to the uploaded file. The key is apended to the url as an anchor tag.
- </td>
- </tr>
- <tr>
- <td>
- <code>fileName</code>
- </td>
- <td>
- <code>string</code>
- </td>
- <td>
- The filename of the uploaded file.
- </td>
- </tr>
- <tr>
- <td>
- <code>contentType</code>
- </td>
- <td>
- <code>string</code>
- </td>
- <td>
- The MIME file type of the uploaded file.
- </td>
- </tr>
- <tr>
- <td>
- <code>contentLength</code>
- </td>
- <td>
- <code>integer</code>
- </td>
- <td>
- The size of the uploaded file in bytes.
- </td>
- </tr>
- <tr>
- <td>
- <code>key</code>
- </td>
- <td>
- <code>string</code>
- </td>
- <td>
- <strong>Optional</strong>
- The key that was used to encrypt the file.
- </td>
- </tr>
- <tr>
- <td>
- <code>keySize</code>
- </td>
- <td>
- <code>int</code>
- </td>
- <td>
- The size of the key used in bits.
- </td>
- </tr>
- <tr>
- <td>
- <code>iv</code>
- </td>
- <td>
- <code>string</code>
- </td>
- <td>
- <strong>Optional</strong>
- The iv that was used to encrypt the file.
- </td>
- </tr>
- <tr>
- <td>
- <code>blockSize</code>
- </td>
- <td>
- <code>int</code>
- </td>
- <td>
- The size of the iv used in bits.
- </td>
- </tr>
- <tr>
- <td>
- <code>maxDownloads</code>
- </td>
- <td>
- <code>int</code>
- </td>
- <td>
- The maximum number of uploads before the upload is deleted.
- </td>
- </tr>
- <tr>
- <td>
- <code>expirationDate</code>
- </td>
- <td>
- <code>datetime</code>
- </td>
- <td>
- The date of expiration of the upload.
- </td>
- </tr>
- <tr>
- <td>
- <code>deletionKey</code>
- </td>
- <td>
- <code>string</code>
- </td>
- <td>
- <strong>Optional</strong>
- The deletion key for file. Use it as follows: <code>@Url.SubRouteUrl("u", "Upload.DeleteByKey", new { file = "file.jpg", key = "deletionKey" })</code>
- </td>
- </tr>
- </tbody>
- </table>
- <h4>Example</h4>
- <pre><code>$ curl -F "genDeletionKey=true" -F "encrypt=true" -F "file=@("@")image.png" @Url.SubRouteUrl("api", "API.v1.Upload")</code></pre>
- <p>
- This will upload the file <var>image.png</var>, encrypt it, and then generate a deletion key.
- </p>
- <br />
- <br />
- </div>
- </div>
|