freewebtemplates
Technical User
Im using php4.0.4pl1 on RedHat7,
the problem is when i post uploaded data via my form the uploaded file is a different byte size than the original.
Below is the code im using for uploads:
<? function upload_file() {
/****************** FILE UPLOAD GLOBALS ******************/
global $splash_prev;
global $splash_prev_name;
global $interior_prev;
global $interior_prev_name;
global $subpage1;
global $subpage1_name;
global $subpage2;
global $subpage2_name;
global $subpage3;
global $subpage3_name;
global $splash_t;
global $splash_t_name;
global $interior_t;
global $interior_t_name;
global $subpage1_t;
global $subpage1_t_name;
global $subpage2_t;
global $subpage2_t_name;
global $subpage3_t;
global $subpage3_t_name;
/****************** FILE UPLOAD PROCESS ******************/
if ($splash_prev_name === "" {
echo "Splash Image Not Selected<BR>";
}
else {
copy($splash_prev, "/home/domains/adulttemplates.com/htdocs/images/splash/$splash_prev_name"
echo "$splash_prev_name Successfully Uploaded!<BR>";
}
if ($splash_t_name === "" {
echo "Splash Thumb Not Selected<BR>";
}
else {
copy($splash_t, "/home/domains/adulttemplates.com/htdocs/images/splash/thumbs/$splash_t_name"
echo "$splash_t_name Successfully Uploaded!<BR>";
}
if ($interior_prev_name === "" {
echo "Interior Image Not Selected<BR>";
}
else {
copy($interior_prev, "/home/domains/adulttemplates.com/htdocs/images/interior/$interior_prev_name"
echo "$interior_prev_name Successfully Uploaded!<BR>";
}
if ($interior_t_name === "" {
echo "Interior Thumb Not Selected<BR>";
}
else {
copy($interior_t, "/home/domains/adulttemplates.com/htdocs/images/interior/thumbs/$interior_t_name"
echo "$interior_t_name Successfully Uploaded!<BR>";
}
if ($subpage1_name === "" {
echo "Subpage1 Image Not Selected<BR>";
}
else {
copy($subpage1, "/home/domains/adulttemplates.com/htdocs/images/subpage1/$subpage1_name"
echo "$subpage1_name Successfully Uploaded!<BR>";
}
if ($subpage1_t_name === "" {
echo "Subpage1 Thumb Not Selected<BR>";
}
else {
copy($subpage1_t, "/home/domains/adulttemplates.com/htdocs/images/subpage1/thumbs/$subpage1_t_name"
echo "$subpage1_t_name Successfully Uploaded!<BR>";
}
if ($subpage2_name === "" {
echo "Subpage2 Image Not Selected<BR>";
}
else {
copy($subpage2, "/home/domains/adulttemplates.com/htdocs/images/subpage2/$subpage2_name"
echo "$subpage2_name Successfully Uploaded!<BR>";
}
if ($subpage2_t_name === "" {
echo "Subpage2 Thumb Not Selected<BR>";
}
else {
copy($subpage2_t, "/home/domains/adulttemplates.com/htdocs/images/subpage2/thumbs/$subpage2_t_name"
echo "$subpage2_t_name Successfully Uploaded!<BR>";
}
if ($subpage3_name === "" {
echo "Subpage3 Image Not Selected<BR>";
}
else {
copy($subpage3, "/home/domains/adulttemplates.com/htdocs/images/subpage3/$subpage3_name"
echo "$subpage3_t_name Successfully Uploaded!<BR>";
}
if ($subpage3_t_name === "" {
echo "Subpage3 Thumb Not Selected<BR>";
}
else {
copy($subpage3_t, "/home/domains/adulttemplates.com/htdocs/images/subpage3/thumbs/$subpage3_t_name"
echo "$subpage3_t_name Successfully Uploaded!<BR>";
}
}
?>
Is there anyway to fix this so that the images that get uploaded are not corrupt?
Doni
the problem is when i post uploaded data via my form the uploaded file is a different byte size than the original.
Below is the code im using for uploads:
<? function upload_file() {
/****************** FILE UPLOAD GLOBALS ******************/
global $splash_prev;
global $splash_prev_name;
global $interior_prev;
global $interior_prev_name;
global $subpage1;
global $subpage1_name;
global $subpage2;
global $subpage2_name;
global $subpage3;
global $subpage3_name;
global $splash_t;
global $splash_t_name;
global $interior_t;
global $interior_t_name;
global $subpage1_t;
global $subpage1_t_name;
global $subpage2_t;
global $subpage2_t_name;
global $subpage3_t;
global $subpage3_t_name;
/****************** FILE UPLOAD PROCESS ******************/
if ($splash_prev_name === "" {
echo "Splash Image Not Selected<BR>";
}
else {
copy($splash_prev, "/home/domains/adulttemplates.com/htdocs/images/splash/$splash_prev_name"
echo "$splash_prev_name Successfully Uploaded!<BR>";
}
if ($splash_t_name === "" {
echo "Splash Thumb Not Selected<BR>";
}
else {
copy($splash_t, "/home/domains/adulttemplates.com/htdocs/images/splash/thumbs/$splash_t_name"
echo "$splash_t_name Successfully Uploaded!<BR>";
}
if ($interior_prev_name === "" {
echo "Interior Image Not Selected<BR>";
}
else {
copy($interior_prev, "/home/domains/adulttemplates.com/htdocs/images/interior/$interior_prev_name"
echo "$interior_prev_name Successfully Uploaded!<BR>";
}
if ($interior_t_name === "" {
echo "Interior Thumb Not Selected<BR>";
}
else {
copy($interior_t, "/home/domains/adulttemplates.com/htdocs/images/interior/thumbs/$interior_t_name"
echo "$interior_t_name Successfully Uploaded!<BR>";
}
if ($subpage1_name === "" {
echo "Subpage1 Image Not Selected<BR>";
}
else {
copy($subpage1, "/home/domains/adulttemplates.com/htdocs/images/subpage1/$subpage1_name"
echo "$subpage1_name Successfully Uploaded!<BR>";
}
if ($subpage1_t_name === "" {
echo "Subpage1 Thumb Not Selected<BR>";
}
else {
copy($subpage1_t, "/home/domains/adulttemplates.com/htdocs/images/subpage1/thumbs/$subpage1_t_name"
echo "$subpage1_t_name Successfully Uploaded!<BR>";
}
if ($subpage2_name === "" {
echo "Subpage2 Image Not Selected<BR>";
}
else {
copy($subpage2, "/home/domains/adulttemplates.com/htdocs/images/subpage2/$subpage2_name"
echo "$subpage2_name Successfully Uploaded!<BR>";
}
if ($subpage2_t_name === "" {
echo "Subpage2 Thumb Not Selected<BR>";
}
else {
copy($subpage2_t, "/home/domains/adulttemplates.com/htdocs/images/subpage2/thumbs/$subpage2_t_name"
echo "$subpage2_t_name Successfully Uploaded!<BR>";
}
if ($subpage3_name === "" {
echo "Subpage3 Image Not Selected<BR>";
}
else {
copy($subpage3, "/home/domains/adulttemplates.com/htdocs/images/subpage3/$subpage3_name"
echo "$subpage3_t_name Successfully Uploaded!<BR>";
}
if ($subpage3_t_name === "" {
echo "Subpage3 Thumb Not Selected<BR>";
}
else {
copy($subpage3_t, "/home/domains/adulttemplates.com/htdocs/images/subpage3/thumbs/$subpage3_t_name"
echo "$subpage3_t_name Successfully Uploaded!<BR>";
}
}
?>
Is there anyway to fix this so that the images that get uploaded are not corrupt?
Doni