php-windows Digest 5 Nov 2005 12:41:47 -0000 Issue 2814

Topics (messages 26461 through 26462):

Re: PHP 5.0 and MySQL Support
        26461 by: Supscriptions

file stream reading
        26462 by: kumar kumar

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [email protected]


----------------------------------------------------------------------
--- Begin Message ---
Hi,

I was in the same boat as you but now have apache 2 working with mysql on 
windows.

Someone posted a link to this site:
http://mpcon.org/apacheguide/apache.php

I unistalled everything and re-installed using the steps shown for apache, php, 
phpmyadmin and mysql. Now everything works although like you, I had to wade 
through loads of forums and newsgroups for age to find this one link. I aqlso 
had no error messages. Would of saved a lot of hassle if it was just mentioned 
in the php zip file.

After installing everything I had to reboot xp. Then I got a php error message. 
If you get it, goto this page http://mpcon.org/apacheguide/phpmyadmin.php, look 
for the 'test' section. step 3 or 4 mentions copying a file from mysql to 
windows/system32. re-boot and everything will work!

--- End Message ---
--- Begin Message ---
hi

The code is written to recive the files sended by the
applet thru http in streams. PHP at server side has to
receive the stream using (php://input)
and as to write at server file  system

this code is not working properly will any body pls
help me in rectifying the error 

for all files i am receiving zero bytes

Here is the code
<?php

    
 $save_path  = $_REQUEST['DATADIR'];
 $filepath = $_REQUEST['FILEPATH'];
 $filename = $_REQUEST['FILENAME'];
 $fname = "$filepath$filename";
 $tdir =$save_path.$filepath;
      mkMDir($tdir);
    function    mkMDir($dir,$dirmode=0777)
   {
       if (!empty($dir))
       {
           if (!file_exists($dir))
           {
               preg_match_all('/([^\/]*)\/?/i',
$dir,$tmp);
               $default="";
               foreach ($tmp[0] as $key=>$val)
               {
                   $default=$default.$val;
                   if(!file_exists($default))
                       if (!mkdir($default,$dirmode))
                       {
                           return -1;
                       }
               }
           }
           else
               if (!is_dir($dir))
               {
                   return -2;
               }
       }

       return 0;

   }            

                
 $getdata = fopen("php://input","r");
 $path ="$save_path" .  dirname($fname);
 $fname = $save_path . $fname;
                
 if(isset($offset) && $offset > 0 && $offset <=       
                filesize($fname))
 {
        $fp = fopen($fname,"a+");
        fseek($fp,$offset);
 }
 else{
        $fp = fopen($fname,"wb");
}

while (!feof($gettdata))
{
        $data = fread($getdata,1024);
        fwrite($fp,$data);
}
        fclose($fp);
        fclose($putdata);
?>

Thanking You
With Regards 
Kumar

 




                
__________________________________ 
Yahoo! FareChase: Search multiple travel sites in one click.
http://farechase.yahoo.com

--- End Message ---

Reply via email to