Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Upload problems with php mysql

Status
Not open for further replies.

freewebtemplates

Technical User
Nov 28, 2001
1
US
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 === &quot;&quot;) {
echo &quot;Splash Image Not Selected<BR>&quot;;
}
else {
copy($splash_prev, &quot;/home/domains/adulttemplates.com/htdocs/images/splash/$splash_prev_name&quot;);
echo &quot;$splash_prev_name Successfully Uploaded!<BR>&quot;;
}

if ($splash_t_name === &quot;&quot;) {
echo &quot;Splash Thumb Not Selected<BR>&quot;;
}
else {
copy($splash_t, &quot;/home/domains/adulttemplates.com/htdocs/images/splash/thumbs/$splash_t_name&quot;);
echo &quot;$splash_t_name Successfully Uploaded!<BR>&quot;;
}

if ($interior_prev_name === &quot;&quot;) {
echo &quot;Interior Image Not Selected<BR>&quot;;
}
else {
copy($interior_prev, &quot;/home/domains/adulttemplates.com/htdocs/images/interior/$interior_prev_name&quot;);
echo &quot;$interior_prev_name Successfully Uploaded!<BR>&quot;;
}

if ($interior_t_name === &quot;&quot;) {
echo &quot;Interior Thumb Not Selected<BR>&quot;;
}
else {
copy($interior_t, &quot;/home/domains/adulttemplates.com/htdocs/images/interior/thumbs/$interior_t_name&quot;);
echo &quot;$interior_t_name Successfully Uploaded!<BR>&quot;;
}

if ($subpage1_name === &quot;&quot;) {
echo &quot;Subpage1 Image Not Selected<BR>&quot;;
}
else {
copy($subpage1, &quot;/home/domains/adulttemplates.com/htdocs/images/subpage1/$subpage1_name&quot;);
echo &quot;$subpage1_name Successfully Uploaded!<BR>&quot;;
}

if ($subpage1_t_name === &quot;&quot;) {
echo &quot;Subpage1 Thumb Not Selected<BR>&quot;;
}
else {
copy($subpage1_t, &quot;/home/domains/adulttemplates.com/htdocs/images/subpage1/thumbs/$subpage1_t_name&quot;);
echo &quot;$subpage1_t_name Successfully Uploaded!<BR>&quot;;
}


if ($subpage2_name === &quot;&quot;) {
echo &quot;Subpage2 Image Not Selected<BR>&quot;;
}
else {
copy($subpage2, &quot;/home/domains/adulttemplates.com/htdocs/images/subpage2/$subpage2_name&quot;);
echo &quot;$subpage2_name Successfully Uploaded!<BR>&quot;;
}


if ($subpage2_t_name === &quot;&quot;) {
echo &quot;Subpage2 Thumb Not Selected<BR>&quot;;
}
else {
copy($subpage2_t, &quot;/home/domains/adulttemplates.com/htdocs/images/subpage2/thumbs/$subpage2_t_name&quot;);
echo &quot;$subpage2_t_name Successfully Uploaded!<BR>&quot;;
}


if ($subpage3_name === &quot;&quot;) {
echo &quot;Subpage3 Image Not Selected<BR>&quot;;
}
else {
copy($subpage3, &quot;/home/domains/adulttemplates.com/htdocs/images/subpage3/$subpage3_name&quot;);
echo &quot;$subpage3_t_name Successfully Uploaded!<BR>&quot;;
}


if ($subpage3_t_name === &quot;&quot;) {
echo &quot;Subpage3 Thumb Not Selected<BR>&quot;;
}
else {
copy($subpage3_t, &quot;/home/domains/adulttemplates.com/htdocs/images/subpage3/thumbs/$subpage3_t_name&quot;);
echo &quot;$subpage3_t_name Successfully Uploaded!<BR>&quot;;
}


}

?>


Is there anyway to fix this so that the images that get uploaded are not corrupt?

Doni
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top