Re: put method

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



i think i would be clearer with this code i have written to do that but in vain.


<?php
if(isset($_PUT['submit'])){
   $fileName=$_PUT['userfile'];
/* PUT data comes in on the stdin stream */
$putdata = fopen("php://stdin", "r");

/* Open a file for writing */
$fp = fopen("$fileName", "w");

/* Read the data 1 KB at a time
   and write to the file */
while ($data = fread($putdata, 1024))
  fwrite($fp, $data);

/* Close the streams */
fclose($fp);
fclose($putdata);
}
else{
    echo "<form method='put' action='putMethod.php'
enctype='multipart/form-data'>";
    echo "Send this file: <input name='userfile' type='file'>"
    echo "<input type='submit' name='submit' value='Send File'>";
    echo "</form>";

}

?>

Parse error: parse error, unexpected T_ECHO, expecting ',' or ';' in
/home/zenrays/public_html/test2/putMethod.php on line "something"
 something= the line number for 'echo "<form method='put'
action='putMethod.php' enctype='multipart/form-data'>";'

On 1/24/06, Jay Paulson <Jay.Paulson@xxxxxxxxxxxxxx> wrote:
> http://us3.php.net/features.file-upload
>
>
> On 1/24/06 11:46 AM, "sunaram patir" <sunaram@xxxxxxxxx> wrote:
>
> > could anyone please tell me how to use put method to upload file to a
> > remote server? thanks.
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
>

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux