Post request, server side php scrript: not using forms

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
Hello Group members,
I have access to server side php script which takes parameters from a
form and processes
the buffer and saves the file.

However, I, as an implementor, do not have the luxury to use form based
scripts.  All I want
to do is telnet to server and type in whole buffer/filename and use

Header for Content_disposition.

For buffers I would use

Content-Disposition: inline   // Send the buffer

and if I want to send a file "a.b" and I want server to save this file
on the server in
filename "abcde"  then I will send the file content as buffer and
include the following

Content-Disposition: attachment; filename=abcde;

I want the server to echo the content of the buffer and save the file
in the filename variable.

I am successful using the form, but this is not what I want to do.  I
want to telnet to the server
which can take the post request and follow my wishes.

The following two scripts do not serve my purpose. because they are
designed to work with
forms.  Could someone tell me what need I change in these scripts so
that these will work
with the command line.

*********************Two scripts do not serve my purpose

$uploaddir = '/var/www/uploads/';
$uploadfile = $uploaddir . basename($_FILES['userfile']['name']);

echo '<pre>';
if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) {
   echo "File is valid, and was successfully uploaded.\n";
} else {
   echo "Possible file upload attack!\n";

echo 'Here is some more debugging info:';

print "</pre>";


and ----------------



Thanks in advance.  


Re: Post request, server side php scrript: not using forms

On 8 Sep 2006 10:30:15 -0700, Vinay Nagrik wrote...
Quoted text here. Click to load it

Since you're using telnet you can probably run a PHP-based script from the
command line like "php -f /path/to/phpscript.php". More detail on that can be
found here.

Since you wouldn't be able to submit the form the "post" method wouldn't work so
you might need to use the "get" ($_GET variables) method.

Help a Community by Participating in Ours  
We donate your subscription fees to the charity you choose  
100% of your first month, 10% thereafter.

Site Timeline