Hmm. I don't know one thing you could try is putting $image in quotes,
like '$image'. Also you might try to use the code I have pasted below.
Using exec is probably not the most effecient way to do the copy of the
file (and using mv limits you to *nix). Make sure you remove the checks
for image type files that I make in the checkImgType() function.
HTH,
Michael
if($Image!="none"){
$ImageExt=checkImgType($Image_type,$Image_name);
}
if($Image!="none"){
$ImageFinal=$ABS_PRODUCTS_IMAGES_DIR.$LastInsertID."Image".$ImageExt;
copy($Image, $ImageFinal);
}
function checkImgType($image_type,$image_name){
if((strcmp($image_type,"image/jpeg")==0)||(strcmp($image_type,"image/gif")==0)||(strcmp($image_type,"image/pjpeg")==0)||(strcmp($image_type,"image/jpg")==0))
{
switch($image_type){
case "image/jpg":
$imageExt=".jpg";
break;
case "image/jpeg":
$imageExt=".jpg";
break;
case "image/pjpeg":
$imageExt=".jpg";
break;
case "image/gif":
$imageExt=".gif";
break;
}
return $imageExt;
}else
{
print "<b><font color=red>$image_name is not a valid file to upload.<br>
Please upload JPEG (.jpg) or GIF (.gif) type images
only.</font></b><br> <br>";
return 0;
}
}
Brian Drexler wrote:
> <?
> exec( "mv $image '$Destination/$FileName'");
> ?>
>
> ----- Original Message -----
> From: Michael Stearne <[EMAIL PROTECTED]>
> To: Brian Drexler <[EMAIL PROTECTED]>
> Cc: Php-General <[EMAIL PROTECTED]>
> Sent: Sunday, February 18, 2001 1:55 PM
> Subject: Re: [PHP] Uploading Files via PHP
>
>
>> The script you are using is probably checking the MIME type of the file
>> uploaded and rejecting any of the ones that are not one of the types you
>> listed. Look at or post some of the code you are using to find out if
>> this is the case.
>>
>> Michael
>>
>>
>> Brian Drexler wrote:
>>
>>> I've been using a PHP upload script to upload files to our server, but
>>
> my
>
>>> problem is this. I can't upload anything but JPG, GIF, and HTML files.
>>> Anyone have any idea why? This is probably something simple that I'm
>>
> just
>
>>> overlooking, but please help.
>>>
>>> Brian Drexler
>>>
>>>
>>
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]