Example of multiple file upload
//upload_html.php------------------------------------------------ ---------------------------------------------
Upload file <script> <br>function beforesubmit(forma) <br>{ <br> var indexnamea=forma.indexname.value; <br> var upfilea=forma.upfile.value; <br> var k=/ /g; <br> var indexnamea=indexnamea.replace(k," "); <br> var upfilea=upfilea.replace(k,""); <br> if(indexnamea=="" <br> upfilea=="") <br> { <br> alert("Directory name Or the uploaded directory cannot be empty!"); <br> return false; <br> } <br> return true; <br>} <br></script>
//------------ -------------------------------------------------- -------------------------------------------------- -------
//upload.php-------------------------------- -------------------------------------------------- -----------------------------
//upload_path: The directory path to which the file is to be uploaded
for($i=1;$i<8;$i++)
{
$upfile="upfile".strval($i);
if(chop($$indexname)!=" " and chop($$upfile)!="")
{
$upfilename=($upfile."_name");
$filename=upload_path.$$upfilename;
$copyfile = copy($$upfile,$filename); If (!$copyfile)
die("File upload failed!");
$ls_file.=$$upfilename."n";
$flag=1; {
$ls_msg="No file uploaded, please select again!";
}
echo "n" ;
echo "n" ;
echo "n" ;
echo "n" ;
echo $ls_msg."n";
echo "n" ;
echo "n" ;
?>
http://www.bkjia.com/PHPjc/314784.html
www.bkjia.com
true
http: //www.bkjia.com/PHPjc/314784.html
TechArticle
Example of multiple file upload //upload_html.php---------------- -------------------------------------------------- ----------------------------- HTML HEAD TITLE Upload file/TITLE /HEAD scrip...