Welcome Guest, Not a member yet? Register   Sign In
how to read csv file saved in webserver using codeigniter.
#2

[eluser]EyeAmN8[/eluser]
So it looks like you are headed in the right direction.
Code:
$file_data = $this->upload->data();
              $file_path =  './uploads/'.$file_data['file_name'];

This above code is the way you find a file. Just like an image, but when rendering an image in the browser, the browser knows how to deal with its contents.
With a csv or txt or any file, the browser does not know what to do with it.

So, what you need to do is parse the file for its contents, save them in a collection (array will work), then pass it to the view.

I've never used php for file parsing, I always use perl because I think it handles files much better.

I think in php you could use
Code:
file_get_contents()
and it will return a string of the file's contents. Just google parsing csv files in php and you'll figure it out


Messages In This Thread
how to read csv file saved in webserver using codeigniter. - by El Forum - 05-07-2014, 09:11 AM



Theme © iAndrew 2016 - Forum software by © MyBB