The following the form where i am selecting the file to upload
<?php
ini_set('max_execution_time',120);
ini_set('realpath_cache_size','64k');
echo '<script type="text/javascript" src="'.$mosConfig_absolute_path.'/mambots/editors/tmedit/tmedit.js">
</script>';
?>
<html xmlns="http://www.w3.org/1999/xhtml">
<body>
<form name="form1" method="post" enctype="multipart/form-data" action="<?php echo $mosConfig_live_site ?>/CommunityBuilder/calendar/member.php?task=add">
<table BORDER="0" width="100%" cellpadding="0" cellspacing="0" align="center" >
<?php
getEditorContents( 'editor1', 'elml' );
editorArea( 'editor1','', 'elml', '600', '400', '70', '15' ) ;
?>
<table BORDER="0" width="100%" cellpadding="0" cellspacing="0" align="center">
<tr><td class='sectiontableentry1'><b><?php echo CB_ATTACH1; ?>:</b></td><td class='sectiontableentry1'><input type="file" name="ATTACH1"></td></tr>
<tr><td class='sectiontableentry2'><b><?php echo CB_ATTACH2;?>:</b></td><td class='sectiontableentry2'><input type="file" name="ATTACH2"></td></tr> </table>
<br />
<table BORDER="0">
<tr>
<td ><input type="submit" name="save" value="Submit" class="generalbutton" />
</td>
<td ><input type="reset" name="reset" value="Reset" class="generalbutton"/></td>
</tr>
</table>
</form>
code under member.php file is as follows:
if($FILES[ATTACH1]["size"]>0)
$attach1=uploadFiles(ATTACH1);
if($FILES[ATTACH2]["size"]>0)
$attach2=uploadFiles(ATTACH2);
addMembers($attach1,$attach2);
function uploadFiles($file)
{
if(move_uploaded_file($_FILES[$file]["tmp_name"],
$mosConfig_absolute_path."/upload/$file)
{
$file_saved="insert into #__events_uploadedfiles (filename) values ('".$file."')";
$database->setQuery($file_saved);
$database->Query();
return $file;
}
else
{
echo "canot move the files";
}
}
Any help on this is very much helpful🙂