Thank you for the code snippets.  Unfortunately the problem is that I
can'tget far enough to process the file.  When the php script that
supposed to process the file tests with is_uploaded_file, it fails.  In
addtion, the $HTTP_POST_FILE['userfile']['tmp_name']=none.  So i can't
process anything since, as far as php is concerned, it appears nothing is
uploaded.

Carl


On Wed, 3 Apr 2002, Bob wrote:

> Uhh, yeah, I forgot the getImage function part of the file.. Sorry about
> that.. Here it is..
>
> function getImage( $image, $newName = false )
> {
>     global ${ $image }, ${ $image . "_name" }, ${ $image . "_size" }, ${
> $image . "_type" };
>
>     //check for productImages directory
>     if( !is_dir( "productImages" ) )
>     {
>         if( !mkdir( "productImages", 0777 ) ) die( "<b>Error:</b> Could not
> create productImages directory." );
>     }
>
>     $name = basename( ${ $image . "_name" } );
>     $size = ${ $image . "_size" };
>     $type = ${ $image . "_type" };
>
>     $name = strtolower( $name );
>     $name = str_replace( " ", "_", $name );
>     //$name = ereg_replace( "[\@\$\%\^\~\ \.\,\"\'\(\)\&\*]", "", $name );
>
>     if( $newName )
>     {
>         if( eregi( "\.jpg", $name ) or eregi( "\.jpeg", $name ) ) $ext =
> ".jpg";
>         else $ext = ".gif";
>         $name = $newName . $ext;
>     }
>
>     @copy( ${ $image }, "productImages/$name" );
>     return $name;
> }
>
>
> Let me know if any of this helps..
>
> Bob
>


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

Reply via email to