Hi!
I am trying to upload image file but it is not getting upload. text,html,zip files get uploaded but image file is not getting uploaded. i am using move_uploaded_file() method. Pl. help me.
Moderators: macek, egami, gesf


copy ($HTTP_POST_FILES['img']['tmp_name'], "newfilename.gif");
$dir="../pic/";
if ($HTTP_POST_FILES['bigimg']['size'] > "8") {
$newcount=file("countbig.txt");
$nextcount=$newcount[0]+1;
$cf=fopen("countbig.txt", "w");
fputs($cf, "$nextcount");
fclose($cf);
$ext=explode(".", $HTTP_POST_FILES['bigimg']['name']);
$bigimg_src="big$nextcount.$ext[1]";
copy ($HTTP_POST_FILES['bigimg']['tmp_name'], $dir. $bigimg_src);
} else { $bigimg_src=""; }
if ($HTTP_POST_FILES['smallimg']['size'] > 8){
$newcount=file("countsml.txt");
$nextcount=$newcount[0]+1;
$cf=fopen("countsml.txt", "w");
fputs($cf, "$nextcount");
fclose($cf);
$ext=explode(".", $HTTP_POST_FILES['smallimg']['name']);
$smlimg_src="sml$nextcount.$ext[1]";
copy ($HTTP_POST_FILES['smallimg']['tmp_name'], $dir. $smlimg_src);
} else {
$smlimg_scr="";
}
Return to PHP coding => General
Users browsing this forum: No registered users and 3 guests