aboutsummaryrefslogtreecommitdiffstats
path: root/man/uploadserver.1
blob: 64d670863629f449fb98727a73b889aace9b7f6c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
.TH UPLOADSERVER 1 "January 2025" "uploadserver 0.1.0" "User Commands"
.SH NAME
uploadserver \- simple HTTP file upload server
.SH SYNOPSIS
.B uploadserver
[\fB\-p\fR \fIPORT\fR]
[\fB\-k\fR \fINAME\fR]
.br
.B uploadserver
\fB\-\-raw\fR \fB\-o\fR \fIPATH\fR
[\fB\-p\fR \fIPORT\fR]
.SH DESCRIPTION
.B uploadserver
is a simple HTTP server for receiving file uploads. It supports two modes:
multipart form uploads (default) and raw body uploads.
.PP
In default mode, it serves a web interface for uploading files and stores them
in an \fIuploads/\fR directory. In raw mode, it saves the raw POST request body
directly to a specified file.
.PP
The server uses only Python standard library modules and is compatible with
Python 3.10 and later, including Python 3.13+.
.SH OPTIONS
.TP
.BR \-p ", " \-\-port " " \fIPORT\fR
Port to listen on. Default is 8000.
.TP
.BR \-k ", " \-\-key " " \fINAME\fR
Form field name for file uploads in multipart mode. Default is "file".
.TP
.BR \-\-raw
Accept raw request body as file instead of multipart form data.
Requires \fB\-o\fR option.
.TP
.BR \-o ", " \-\-output " " \fIPATH\fR
Output file path for raw mode. Required when using \fB\-\-raw\fR.
.TP
.BR \-d ", " \-\-debug
Print incoming requests to stderr, including method, path, headers, and body size.
.SH EXAMPLES
Start server with defaults:
.PP
.RS
.nf
uploadserver
.fi
.RE
.PP
Use custom port and form field:
.PP
.RS
.nf
uploadserver -p 9000 -k document
.fi
.RE
.PP
Raw body mode:
.PP
.RS
.nf
uploadserver --raw -o /tmp/received.bin
.fi
.RE
.PP
Upload file with curl (multipart):
.PP
.RS
.nf
curl -F "file=@myfile.txt" http://localhost:8000
.fi
.RE
.PP
Upload file with curl (raw):
.PP
.RS
.nf
curl -X POST --data-binary @myfile.txt http://localhost:8000
.fi
.RE
.SH FILES
.TP
.I uploads/
Default directory where uploaded files are stored (multipart mode).
.SH NOTES
This server has no external dependencies and uses only the Python standard library.
.SH AUTHORS
Written for use with uv.