pull/7/head
parent
18394194dd
commit
5eed3e1466
@ -0,0 +1,6 @@ |
||||
ScriptForm raw example |
||||
====================== |
||||
|
||||
Raw callbacks can be used to obtain more control over what is sent to the |
||||
user's browser. For instance, you can stream contents to the browser, send |
||||
files, show images, etc. |
@ -0,0 +1,11 @@ |
||||
#!/bin/sh |
||||
|
||||
FILESIZE=$(expr 1024 \* 1000 \* 100) |
||||
cat << EOF |
||||
HTTP/1.0 200 Ok |
||||
Content-Type: application/octet-stream |
||||
Content-Disposition: attachment; filename="large_file.dat" |
||||
Content-Length: $FILESIZE |
||||
|
||||
EOF |
||||
dd if=/dev/urandom bs=1024 count=100000 |
@ -0,0 +1,8 @@ |
||||
#!/bin/sh |
||||
|
||||
cat << EOF |
||||
HTTP/1.0 200 Ok |
||||
Content-Type: image/jpeg |
||||
|
||||
EOF |
||||
cat test.jpg |
@ -0,0 +1,21 @@ |
||||
{ |
||||
"title": "Raw callback examples", |
||||
"forms": { |
||||
"show_image": { |
||||
"title": "Show an image", |
||||
"description": "Shows you an image", |
||||
"submit_title": "Show", |
||||
"script": "job_show_image.sh", |
||||
"script_raw": true, |
||||
"fields": {} |
||||
}, |
||||
"large_bin": { |
||||
"title": "Download large binary file", |
||||
"description": "Download a large (100mb) binary file", |
||||
"submit_title": "Download", |
||||
"script": "job_large_bin.sh", |
||||
"script_raw": true, |
||||
"fields": {} |
||||
} |
||||
} |
||||
} |
After Width: | Height: | Size: 11 KiB |
Loading…
Reference in new issue