my $query=new CGI; my $emailid = $query->param('accemailid'); print TMP time; # Just to check whether the file gets executed print TMP $emailid; # TMP is a file handler of a temp file #### $emailid = $_POST['accemailid']; $logfile = "/tmp/in/log.txt"; $fh = fopen($logfile, 'a') or die("can't open file"); fwrite($fh, $emailid); fclose($fh); #### _LIT8(KPostUri, "http://mywebsite.com/upload.pl"); _LIT8(KDataStart,"--AaB03x"); _LIT8(KCrlf,"\r\n"); _LIT8(KContent,"Content-Disposition: form-data; name='userfile'; filename='"); _LIT8(KFileCompletion,"'"); _LIT8(KContentEmail,"Content-Disposition: form-data; name='accemailid'"); _LIT8(KContentComment,"Content-Disposition: form-data; name='comment'");