Archives
Trending
Support
Login
clear text
XML
Django
JavaScript
MATLAB
C
C++
C#
Python
SQL
Shell
Bash
Markdown
YAML
JSON
HTML
CSS
PHP
Java
Ruby
Go
Rust
Swift
Kotlin
Arduino
TypeScript
Perl
Autohotkey
Lua
SQF
R
Scala
Haskell
Groovy
Dart
Clojure
VB.NET
Objective-C
PowerShell
Bash
CoffeeScript
Verilog
#!/bin/sh # POST upload format: # -----------------------------29995809218093749221856446032^M # Content-Disposition: form-data; name="file1"; filename="..."^M # Content-Type: application/octet-stream^M # ^M <--------- headers end with empty line # file contents # file contents # file contents # ^M <--------- extra empty line # -----------------------------29995809218093749221856446032--^M folder=../uploads/ CR=`printf '\r'` # CGI output must start with at least empty line (or headers) echo "Content-type: text/html" printf '\r\n' while read -r line; do #get file name of uploaded file echo "$line" | grep "filename" > /dev/null && file="$(echo "$line"|cut -d\" -f4)" test x"$line" = x"" && break test x"$line" = x"$CR" && break done echo "$file uploaded." cat >"${folder}${file}"
Mark as private (unlisted)
for 30 minutes
for 6 hours
for 1 day
for 1 week
for 1 month
for 1 year
everlasting (like CCCP)