{"id":15373057,"url":"https://github.com/vi/http_file_uploader","last_synced_at":"2025-04-15T14:14:23.731Z","repository":{"id":62445091,"uuid":"556313616","full_name":"vi/http_file_uploader","owner":"vi","description":"Simple low-level web server to serve file uploads with some shell scripting-friendly features","archived":false,"fork":false,"pushed_at":"2022-10-27T14:35:15.000Z","size":36,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-04-15T14:14:17.763Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-10-23T15:13:47.000Z","updated_at":"2024-04-13T21:11:20.000Z","dependencies_parsed_at":"2022-11-01T22:31:03.539Z","dependency_job_id":null,"html_url":"https://github.com/vi/http_file_uploader","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vi%2Fhttp_file_uploader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vi%2Fhttp_file_uploader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vi%2Fhttp_file_uploader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vi%2Fhttp_file_uploader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vi","download_url":"https://codeload.github.com/vi/http_file_uploader/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249085429,"owners_count":21210267,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-01T13:54:11.803Z","updated_at":"2025-04-15T14:14:23.711Z","avatar_url":"https://github.com/vi.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# http_file_uploader\n\nSimple low-level web server to serve file uploads with some shell scripting-friendly features. A bridge between Web's multipart/form-data file upload world and UNIX-ey files and command lines world. Somewhat close in spirit to CGI, but without the flexibility (hopefully with security instead).\n\nHTTP listening features:\n\n* Listening for connections on TCP address\n* Listening for connections on UNIX path\n* Using stdin/stdout to serve one connection, inetd-style\n* Accepting connections from a pre-bound TCP or UNIX socket e.g. from SystemD socket activation service\n* Decoding multipart request bodies, selecting specific field from it (or optionally just streaming the whole request body). Or just simply starting programs on each request (even without body).\n\nSink features:\n\n* Dumping the file being received to stdout\n* Saving the file to filesystem (and maybe moving it elsewhere if upload is finished successfully)\n* Starting external program to handle the upload. The data would appear on stdin.\n\nSee \"CLI usage message\" section below for the exhausive list of options.\n\nMost HTTP request parameters are ignored - it only concerns about the incoming data. Use nginx/caddy to filter and shape request and responses the way you like instead. You can select the field of the form to process, but other fields are ignored.\n\n# Installation\n\nBuild it from source code with `cargo install --path .`, install from crates.io using `cargo install http_file_uploader` or download a pre-built version from [Github Releases](https://github.com/vi/http_file_uploader/releases/).\n\n# Examples\n\n```\n$ httpfileuploader -l 127.0.0.1:8080 --stdout |\nIncoming connection from 127.0.0.1:32876      | $ curl http://127.0.0.1:8080/ --form aaa=www\nwww                                           | Upload successful\n\n$ httpfileuploade  -l 127.0.0.1:8080 -B -c --url -- echo\nIncoming connection from 127.0.0.1:46750      | $ curl http://127.0.0.1:8080/asd?fgh\n                                              | /asd?fgh\n\n$ httpfileuploader  -l 127.0.0.1:8080 -o myupload.txt.tmp --rename-complete myupload.txt --once\nIncoming connection from 127.0.0.1:48712      | $ curl http://127.0.0.1:8080 --form f=@Cargo.toml\n                                              | Upload successful\n$ cmp myupload.txt Cargo.toml\n\n$ http_file_uploader -l 127.0.0.1:1234 -r -P -I --cmdline -- stdbuf -oL /bin/rev\u0026\n$ nc 127.0.0.1 1234\nPOST / HTTP/1.0\nContent-Length: 1000\n\nHTTP/1.0 200 OK\ndate: Thu, 27 Oct 2022 13:26:14 GMT\n\nHello, world\ndlrow ,olleH\n12345\n54321\n^C\n```\n\n# CLI usage message\n\n```\nhttp-file-uploader\n  Special web server to allow shell scripts and other simple UNIX-ey programs to handle multipart/form-data HTTP  file uploads\n\nARGS:\n    \u003cargv\u003e...\n      Command line array for --cmdline option\n\nOPTIONS:\n    -l, --listen \u003caddr\u003e\n      Bind and listen specified TCP socket\n\n    -u, --unix \u003cpath\u003e\n      Optionally remove and bind this UNIX socket for listening incoming connections\n\n    --inetd\n      Read from HTTP request from stdin and write HTTP response to stdout\n\n    --accept-tcp\n      Expect file descriptor 0 (or specified) to be pre-bound listening TCP socket e.g. from systemd's socket activation\n      You may want to specify `--fd 3` for systemd\n\n    --accept-unix\n      Expect file descriptor 0 (or specified) to be pre-bound listening UNIX socket e.g. from systemd's socket activation\n      You may want to specify `--fd 3` for systemd\n\n    --fd \u003cfd\u003e\n      File descriptor to use for --inetd or --accept-... modes instead of 0.\n\n    --once\n      Serve only one successful upload, then exit.\n      Failed child process executions are not considered as unsuccessful uploads for `--once` purposes, only invalid HTTP requests.\n      E.g. trying to write to /dev/full does exit with --once, but failure to open --output file does not.\n\n    -O, --stdout\n      Dump contents of the file being uploaded to stdout.\n\n    -o, --output \u003cpath\u003e\n      Save the file to specified location and overwrite it for each new upload\n\n    -p, --program \u003cpath\u003e\n      Execute specified program each time the upload starts, without CLI parameters by default and file content as in stdin\n      On UNIX, SIGINT is sent to the process if upload is terminated prematurely\n\n    -c, --cmdline\n      Execute command line (after --) each time the upload starts. URL is not propagated. Uploaded file content is in stdin.\n      On UNIX, SIGINT is sent to the process if upload is terminated prematurely\n\n    -n, --name \u003cfield_name\u003e\n      Restrict multipart field to specified name instead of taking first encountred field.\n\n    -r, --require-upload\n      Require a file to be uploaded, otherwise failing the request.\n\n    -L, --parallelism\n      Allow multiple uploads simultaneously without any limit\n\n    -j, --parallelism-limit \u003climit\u003e\n      Limit number of upload-serving processes running in parallel.\n      You may want to also use -Q option\n\n    -Q, --queue \u003clen\u003e\n      Number of queued waiting requests before starting failing them with 429. Default is no queue.\n      Note that single TCP connection can issue multiple requests in parallel, filling up the queue.\n\n    -B, --buffer-child-stdout\n      Buffer child process output to return it to HTTP client as text/plain\n\n    -I, --pipe\n      Don't bother calculating Content-Length, instead pipe child process's stdout to HTTP reply chunk by chunk\n\n    --remove-incomplete\n      Remove --output file if the upload was interrupted\n\n    --rename-complete \u003cpath\u003e\n      Move --output's file to new path after the upload is fully completed\n\n    -U, --url\n      Append request URL as additional command line parameter\n\n    --url-base64\n      Append request URL as additional command line parameter, base64-encoded\n\n    -q, --quiet\n      Do not announce new connections\n\n    -P, --allow-nonmultipart\n      Allow plain, non-multipart/form-data requests (and stream body chunks instead of form field's chunks)\n\n    --no-multipart\n      Don't try to decode multipart/form-data content, just stream request body as is always.\n\n    -M, --method\n      Append HTTP request method to the command line parameters (before --url if specified)\n\n    -h, --help\n      Prints help information.\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvi%2Fhttp_file_uploader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvi%2Fhttp_file_uploader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvi%2Fhttp_file_uploader/lists"}