Upload images along with my news items ? |
[eluser]invision[/eluser]
Hi, Recently I built an incredibly basic news management system for my own portfolio site. I'd like to extend this to show thumbnails for each news post. I would love to get a little help in doing this. I've attached my code so far for reference. Here's my Model: Code: function addNews(){ My View: Code: <h1><?php echo $title;?></h1> and my Controller: Code: function create(){ I was using this as a resource but I struggled with it. I basically want to upload an image to be associated with each news entry. I'd love some help with this. Many thanks.
[eluser]farinspace[/eluser]
Sorry if i don't get too detailed, but hopefully I can point you in the right direction. Your "addNews" method will need something like this to handle the uploaded file: Code: $config = array
[eluser]invision[/eluser]
Thanks for the reply. I actually did try something like that before posting here. I'll give it another shot and see how I go. Will be back shortly ![]()
[eluser]Phil Sturgeon[/eluser]
What does the code for your attempt look like.
[eluser]invision[/eluser]
Many thanks for the reply Phil. Code: function addNews(){ I've tried to put this together from the Upload class at CI : http://ellislab.com/codeigniter/user-gui...ading.html
[eluser]Phil Sturgeon[/eluser]
You have commented out the single most important line. Code: $this->upload->do_upload()
|
Welcome Guest, Not a member yet? Register Sign In |