Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><strong>CGI to the rescue!</strong></p> <p>If you create a cgi-bin directory, and configure appropriately, you'll get the message via stdin (as far as I can tell, files aren't written to disk at all this way).</p> <p>So, in your apache config add</p> <pre><code>ScriptAlias /cgi-bin/ /var/www/&lt;site-dir&gt;/cgi-bin/ &lt;Directory "/var/www/&lt;site-dir&gt;/cgi-bin"&gt; AllowOverride None Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch Order allow,deny Allow from all &lt;/Directory&gt; </code></pre> <p>Then write a CGI-mode PHP script to parse the post data. From my (limited) testing, no local files appear to be created. The sample dumps what it reads from stdin as well as the environment variables, to give you an idea of what's there to work with.</p> <p><strong>Sample script</strong> installed as /var/www//cgi-bin/test</p> <pre><code>#!/usr/bin/php Content-type: text/html &lt;html&gt;&lt;body&gt; &lt;form enctype="multipart/form-data" action="/cgi-bin/test" method="POST"&gt; &lt;!-- MAX_FILE_SIZE must precede the file input field --&gt; &lt;input type="hidden" name="MAX_FILE_SIZE" value="30000" /&gt; &lt;!-- Name of input element determines name in $_FILES array --&gt; Send this file: &lt;input name="userfile" type="file" /&gt; &lt;input type="submit" value="Send File" /&gt; &lt;/form&gt; &lt;pre&gt; &lt;? echo "\nRequest body\n\n"; $handle = fopen ("php://stdin","r"); while (($line = fgets($handle))) echo "$line"; fclose($handle); echo "\n\n"; phpinfo(INFO_ENVIRONMENT); echo "\n\n"; ?&gt; &lt;/pre&gt; &lt;/body&gt;&lt;/html&gt; </code></pre> <p><strong>Sample output</strong> This is the output (source) when I upload a plain-text file:</p> <pre><code>&lt;html&gt;&lt;body&gt; &lt;form enctype="multipart/form-data" action="/cgi-bin/test" method="POST"&gt; &lt;!-- MAX_FILE_SIZE must precede the file input field --&gt; &lt;input type="hidden" name="MAX_FILE_SIZE" value="30000" /&gt; &lt;!-- Name of input element determines name in $_FILES array --&gt; Send this file: &lt;input name="userfile" type="file" /&gt; &lt;input type="submit" value="Send File" /&gt; &lt;/form&gt; &lt;pre&gt; Request body -----------------------------19908123511077915841334811274 Content-Disposition: form-data; name="MAX_FILE_SIZE" 30000 -----------------------------19908123511077915841334811274 Content-Disposition: form-data; name="userfile"; filename="uploadtest.txt" Content-Type: text/plain This is some sample text -----------------------------19908123511077915841334811274-- phpinfo() Environment Variable =&gt; Value HTTP_HOST =&gt; dev.squello.com HTTP_USER_AGENT =&gt; Mozilla/5.0 (X11; U; Linux x86_64; en-GB; rv:1.9.2.16) Gecko/20110323 Ubuntu/10.04 (lucid) Firefox/3.6.16 HTTP_ACCEPT =&gt; text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 HTTP_ACCEPT_LANGUAGE =&gt; en-gb,en;q=0.5 HTTP_ACCEPT_ENCODING =&gt; gzip,deflate HTTP_ACCEPT_CHARSET =&gt; ISO-8859-1,utf-8;q=0.7,*;q=0.7 HTTP_KEEP_ALIVE =&gt; 115 HTTP_CONNECTION =&gt; keep-alive HTTP_REFERER =&gt; http://dev.squello.com/cgi-bin/test CONTENT_TYPE =&gt; multipart/form-data; boundary=---------------------------19908123511077915841334811274 CONTENT_LENGTH =&gt; 376 PATH =&gt; /usr/local/bin:/usr/bin:/bin SERVER_SIGNATURE =&gt; &lt;address&gt;Apache/2.2.14 (Ubuntu) Server at dev.squello.com Port 80&lt;/address&gt; SERVER_SOFTWARE =&gt; Apache/2.2.14 (Ubuntu) SERVER_NAME =&gt; dev.squello.com SERVER_ADDR =&gt; 127.0.0.1 SERVER_PORT =&gt; 80 REMOTE_ADDR =&gt; 127.0.0.1 DOCUMENT_ROOT =&gt; /var/www/dev.squello.com/www SERVER_ADMIN =&gt; webmaster@localhost SCRIPT_FILENAME =&gt; /var/www/dev.squello.com/cgi-bin/test REMOTE_PORT =&gt; 58012 GATEWAY_INTERFACE =&gt; CGI/1.1 SERVER_PROTOCOL =&gt; HTTP/1.1 REQUEST_METHOD =&gt; POST QUERY_STRING =&gt; REQUEST_URI =&gt; /cgi-bin/test SCRIPT_NAME =&gt; /cgi-bin/test &lt;/pre&gt; &lt;/body&gt;&lt;/html&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload