api section in faq; brighter code background
This commit is contained in:
+2
-1
@@ -1,6 +1,7 @@
|
|||||||
:root {
|
:root {
|
||||||
--bg: #191919;
|
--bg: #191919;
|
||||||
--surface: #2a2a2a;
|
--surface: #2a2a2a;
|
||||||
|
--surface-between: #3a3a3a;
|
||||||
--surface-hover: #4a4a4a;
|
--surface-hover: #4a4a4a;
|
||||||
--text: #eee;
|
--text: #eee;
|
||||||
--text-muted: #aaa;
|
--text-muted: #aaa;
|
||||||
@@ -242,6 +243,6 @@ body.dragging::after {
|
|||||||
}
|
}
|
||||||
|
|
||||||
code {
|
code {
|
||||||
background-color: var(--surface);
|
background-color: var(--surface-between);
|
||||||
padding-inline: 4px;
|
padding-inline: 4px;
|
||||||
}
|
}
|
||||||
+15
-4
@@ -24,6 +24,11 @@
|
|||||||
be wary of any metadata included in the files you are uploading,
|
be wary of any metadata included in the files you are uploading,
|
||||||
especially photos from a phone as they may contain GPS data.
|
especially photos from a phone as they may contain GPS data.
|
||||||
</p>
|
</p>
|
||||||
|
{{if .NormalizeMIMETypes}}
|
||||||
|
<h3>why are my html/svg/pdf uploads not being rendered?</h3>
|
||||||
|
<p>they are being normalized for security.</p>
|
||||||
|
{{end}}
|
||||||
|
<h2>api usage</h2>
|
||||||
<h3>how do i upload via the api?</h3>
|
<h3>how do i upload via the api?</h3>
|
||||||
<p>
|
<p>
|
||||||
send a POST request to <code>/upload</code>. for files, use multipart
|
send a POST request to <code>/upload</code>. for files, use multipart
|
||||||
@@ -38,14 +43,20 @@
|
|||||||
$i}},{{end}}{{$expiry.Label}}{{end}}</code
|
$i}},{{end}}{{$expiry.Label}}{{end}}</code
|
||||||
>. omitting an expiry will use the first expiry listed.
|
>. omitting an expiry will use the first expiry listed.
|
||||||
</p>
|
</p>
|
||||||
|
<p>
|
||||||
|
you can also specify if you would prefer a long or short upload id, just
|
||||||
|
append <br> <code>?idlength=short</code> to get a shorter id (10 characters),
|
||||||
|
otherwise it defaults to long (16 character)
|
||||||
|
</p>
|
||||||
<h4>uploading the output of a command</h4>
|
<h4>uploading the output of a command</h4>
|
||||||
<code>cat super-cool-text.txt | curl -T - {{.Host}}/upload</code>
|
<code>cat super-cool-text.txt | curl -T - {{.Host}}/upload</code>
|
||||||
<h4>upload a file via curl</h4>
|
<h4>upload a file via curl</h4>
|
||||||
<code>curl -F "file=@very-cool-image.png" {{.Host}}/upload</code>
|
<code>curl -F "file=@very-cool-image.png" {{.Host}}/upload</code>
|
||||||
{{if .NormalizeMIMETypes}}
|
<h3>getting upload info</h3>
|
||||||
<h3>why are my html/svg/pdf uploads not being rendered?</h3>
|
<p>
|
||||||
<p>they are being normalized for security.</p>
|
you can retrieve an upload's metadata by simply appending <code>/info</code> to the end of an upload, like <code>/{id}/info</code>.
|
||||||
{{end}}
|
it returns all stored metadata except for the original filename.
|
||||||
|
</p>
|
||||||
</main>
|
</main>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
Reference in New Issue
Block a user