Note that there are some explanatory texts on larger screens.

plurals
  1. POmPDF realtime uploading not working
    primarykey
    data
    text
    <p>I've been trying to upload a mpdf generated file now the problem I have is it doesn't put it in my desired directory.</p> <p>My structure looks like this:</p> <p>-application-</p> <p>-cgi-bin-</p> <p>-files- -system-</p> <p>-user_guide-</p> <p>Here's the code:</p> <pre><code>function save_answers() { $this-&gt;load-&gt;library('mpdf'); $mpdf=new mPDF(); $user = $this-&gt;ion_auth-&gt;get_user(); $uid = $user-&gt;id; $lid = $this-&gt;input-&gt;post('looper'); $html = ''; $html .= 'Examinee: '.$user-&gt;username; $html .= '&lt;br /&gt;Date taken: '. date('Y-m-d').'&lt;br /&gt;'; for ($i=1; $i&lt;=$lid; $i++) { $html .= 'Question: '.$this-&gt;input-&gt;post('qname_'.$i).'&lt;br /&gt;'; $html .= 'Answer: '.$this-&gt;input-&gt;post('answer_'.$i).'&lt;br /&gt;&lt;br /&gt;'; } $html .= '&lt;small&gt;&lt;i&gt;End of monthly exam. Ths is a system_generated item.&lt;/i&gt;&lt;/small&gt;'; $data['xid'] = $this-&gt;input-&gt;post('xid'); $data['uid'] = $this-&gt;input-&gt;post('uid'); $mpdf-&gt;WriteHTML($html); $filename = mt_rand(11111, 22222) + $uid; $data['pdf'] = $mpdf-&gt;Output($filename, 'D'); $config['upload_path'] = 'files/'; $config['max_size'] = '1000'; $config['max_width'] = '1920'; $config['max_height'] = '1280'; $this-&gt;load-&gt;library('upload', $config); if(!$this-&gt;upload-&gt;do_upload()) echo $this-&gt;upload-&gt;display_errors(); else { $fInfo = $this-&gt;upload-&gt;data(); #$this-&gt;_createThumbnail($fInfo['file_name']); $data['uploadInfo'] = $fInfo; $data['file_name'] = $filename; #$data['thumbnail_name'] = $fInfo['raw_name'] . '_thumb' . $fInfo['file_ext']; if($this-&gt;Exam_model-&gt;score_updater($data)) { $this-&gt;session-&gt;set_flashdata('msg_success', 'Successfully taken and saved'); redirect('home', 'refresh'); } } $mpdf-&gt;Output($filename, 'D'); } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload