extension changed??

They have: 164 posts

Joined: Nov 2001

why the extension of the image changed when i upload??
my code:

<?php
$ext
= substr($re_image, -3, 3);
       
$path = \"../template/imga/\";
       
$filename = \"img\".$category_ID.\".\".$ext;
       
$image = $path.$filename;
        move_uploaded_file(
$re_image, $image);
?>

the extension of the image suppose to be jpg or gif...but it changed to other extensions...

if i used copy instead of move_uploaded_file, then the extension will remains jpg or gif...why will it happend??

They have: 164 posts

Joined: Nov 2001

got it solved..just need to change this line:

<?php
$ext
= substr($re_image, -3, 3);
?>

to

<?php
$ext
= substr($re_image_name, -3, 3);
?>

then i can get the original file name.

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.