<?
/*****************************************************************************
This program is written by rajendra kumar shrestha and email is rajensama@yahoo.com
If you have any problem you can see the code demo in www.rajensama.com
The upload system contains twofiles. To use this uploading files you have to
the following things first.
1. separate files upload1.php and upload2.php then upload to your web server.
You can put these two files in any directory but both of them should be in same
direcotry
in the same
2. create a directory called "uploaded" in the document root
3. set the chmod to the directory as 777
4.Repalce the directory
c:/program files/apache group/apache/htdocs/ with your document root and
similarly if it is in linux , replace this
/usr/local/httpd/htdocs/kunden/web269/html with document root.
For document root see the phpinfo file or create a file with
phpinfo() function.
5.
*****************************************************************************/
?>
<html>
<head>
<TITLE>Uploading files</TITLE>
<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'>
<meta NAME='Description' content="Uploading files ">
</head>
<body>
<table width="659" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="659" height="954" valign="top">
<table width="90%" border="1" bgcolor="#FFCC99">
<tr>
<td bgcolor="#FFCC66">
<div align="center"><b><font size="4">Please fill the following details
to upload the files</font></b></div>
</td>
</tr>
</table>
<form action="upload2.php" method="post" enctype="multipart/form-data">
if(is_uploaded_file($userfile[$i]))
{
print("<BR>");
print("userfile[$i]=$userfile[$i] ");
print("Actual file name is $userfile_name[$i] ");
if (is_uploaded_file($userfile[$i]))
{
//This lines copies the temporary files to the specified directory and
//renames it to original name
//here /usr/local/httpd/htdocs/kunden/web269/html is document root .
//You have to replace the document root part with the docuemnt root of your server
//which you can see using phpinfo() function
// Then create a directory called "uploaded" and assign chmod value of 777
//to this directory
//This is where most of the novo programmer fails
// Because PHP upload the file and deletes immediately so we have to
//copy before it deletes
//This is , I have used with linux
//copy($userfile
[$i], "/usr/local/httpd/htdocs/kunden/web269/html/uploaded/".$userfile_name[$i]);
//This is , I have used with windows
copy($userfile[$i], "c:/program files/apache
group/apache/htdocs/uploaded/".$userfile_name[$i]);