reading lines from file |
[eluser]rajneeshgobin[/eluser]
i have these code view of the form Code: <?php echo form_open_multipart('uploadctrl/processID');?> controller Code: $this->load->library('upload', $config); in shome i wish to display the content of the file in the file i have a few lines like student_name surname file.txt Code: hello world ect how can i list these data in the display page shome?
[eluser]RobertSF[/eluser]
I have not tried it myself, but I found this in the CodeIgniter 2.1.2 User Guide. $this->upload->data() returns an array, but the array does not contain the uploaded file. Instead, it contains information about the uploaded file. This is the information it contains. Code: Array So before you load the view, you must use the above information to read the file. You can use something like this. Code: $uploaded_file_info = $this->upload->data(); Here's information on the PHP function get_file_contents. http://php.net/manual/en/function.file-get-contents.php |
Welcome Guest, Not a member yet? Register Sign In |