- add missing support for raw post data (HttpRequest)
[m6w6/ext-http] / docs / examples / Bandwidth_Throttling.php
diff --git a/docs/examples/Bandwidth_Throttling.php b/docs/examples/Bandwidth_Throttling.php
new file mode 100644 (file)
index 0000000..981272c
--- /dev/null
@@ -0,0 +1,9 @@
+<?php
+// send 5000 bytes every 0.2 seconds, i.e. max ~25kByte/s
+HttpResponse::setThrottleDelay(0.2);
+HttpResponse::setBufferSize(5000);
+HttpResponse::setCache(true);
+HttpResponse::setContentType('application/x-zip');
+HttpResponse::setFile('../archive.zip');
+HttpResponse::send();
+?>