Mr. Goodie2Shoes
Well-known member
so yes, the POST name is 'file' and here's a part of the admin template:
and this is the part of the controller that processes the inputs:
and everything is working perfectly except this... and here's a pic of the error messsage:

P.S. This is under development and will go through loads of trials and errors, so don't worry any of the security flaws
Code:
<xen:form action="{xen:adminlink 'downloads/upload/save'}" class="AutoValidator" data-redirect="on">
<fieldset>
<xen:selectunit name="subject" value="" label="Subject Code:">
<xen:options source="$subjectsOption" />
</xen:selectunit>
<xen:selectunit name="year" value="" label="Select Year:">
<xen:options source="$yearsOption" />
</xen:selectunit>
<xen:uploadunit label="Select Archive:" name="file" value=""></xen:uploadunit>
</fieldset>
<xen:submitunit save="Upload & Save Archive">
</xen:submitunit>
</xen:form>
Code:
public function actionUploadSave() {
$pass = '~something~';
$ch = curl_init('~something...~');
$post_fields = "&pass=$pass";
$post_fields .= "&file=".$_REQUEST['file'];
$post_fields .= "&do=uploadarchive";
$post_fields .= "&year=".$_REQUEST['year'];
$post_fields .= "&subject=".$_REQUEST['subject'];
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_fields);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_exec($ch);
curl_close($ch);
return $this->responseRedirect(XenForo_ControllerResponse_Redirect::SUCCESS, XenForo_Link::buildAdminLink('downloads'));
}

P.S. This is under development and will go through loads of trials and errors, so don't worry any of the security flaws