[thelist] PHP upload test on members.evolt.org

AtdtXav atdtxav at yahoo.com
Tue Mar 5 05:06:01 CST 2002


Thanks, I was unaware that you could get that information
(generically available through the members.evolt.org site)
specifically for your environment.

However, I am already using that path.  Here is my code:

$file_dir = "/home/atdt1991/public_html";
$file_url = "http://members.evolt.org/~atdt1991/uploads";

foreach( $HTTP_POST_FILES as $file_name => $file_array ) {
   print "path: ".$file_array['tmp_name']."<br>\n";
   print "name: ".$file_array['name']."<br>\n";
   print "type: ".$file_array['type']."<br>\n";
   print "size: ".$file_array['size']."<br>\n";

   if ( is_uploaded_file( $file_array['tmp_name'] ) &&
$file_array['type'] == "image/gif" ) {
      move_uploaded_file ($file_array['tmp_name'],
"$file_dir/$file_name") or die ("Couldn't Copy");
      print "<img src=\"$file_url/$file_name\"><p>\n\n";
   }
}
?>

... then a simple file upload form with no ACTION.  My results
inevitably show the file uploaded correctly to the temp
directory, but end with "couldn't copy".

Scott Kennedy
PS thanks for the tip :)

--- Steve Cook <steve.cook at evitbe.com> wrote:
> Have you tried using phpinfo(), looking at mine I would
> suggest that
>
> 	_SERVER["PATH_TRANSLATED"]
>
> Will give you the value you're looking for.
>
>
> .steve
>
>
> ----------------------------------
>    WapWarp - http://wapwarp.com
>  Wap-Dev - http://www.wap-dev.net
>  Cookstour - http://cookstour.org
> ----------------------------------
> --
> For unsubscribe and other options, including
> the Tip Harvester and archive of thelist go to:
> http://lists.evolt.org Workers of the Web, evolt !


__________________________________________________
Do You Yahoo!?
Try FREE Yahoo! Mail - the world's greatest free email!
http://mail.yahoo.com/



More information about the thelist mailing list