normalize mime types; application/octet-stream returns an attachment
This commit is contained in:
+13
-6
@@ -26,19 +26,26 @@
|
||||
</p>
|
||||
<h3>how do i upload via the api?</h3>
|
||||
<p>
|
||||
send a POST request to <code>/upload</code>. for files,
|
||||
use multipart form data with a field named <code>file</code>.
|
||||
for pastes, send the text with <code>Content-Type: text/plain</code>.
|
||||
send a POST request to <code>/upload</code>. for files, use multipart
|
||||
form data with a field named <code>file</code>. for pastes, send the
|
||||
text with <code>Content-Type: text/plain</code>.
|
||||
</p>
|
||||
<p>
|
||||
to add an expiry, append <code>?expiry={value}</code>. <br>supported values are:
|
||||
<code>{{range $i, $expiry := .Expiries}}{{if $i}},{{end}}{{$expiry.Label}}{{end}}</code>.
|
||||
omitting an expiry will use the first expiry listed.
|
||||
to add an expiry, append <code>?expiry={value}</code>. <br />supported
|
||||
values are:
|
||||
<code
|
||||
>{{range $i, $expiry := .Expiries}}{{if
|
||||
$i}},{{end}}{{$expiry.Label}}{{end}}</code
|
||||
>. omitting an expiry will use the first expiry listed.
|
||||
</p>
|
||||
<h4>uploading the output of a command</h4>
|
||||
<code>cat super-cool-text.txt | curl -T - {{.Host}}/upload</code>
|
||||
<h4>upload a file via curl</h4>
|
||||
<code>curl -F "file=@very-cool-image.png" {{.Host}}/upload</code>
|
||||
{{if .NormalizeMIMETypes}}
|
||||
<h3>why are my html/svg/pdf uploads not being rendered?</h3>
|
||||
<p>they are being normalized for security.</p>
|
||||
{{end}}
|
||||
</main>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user