Question about Uploading image |
[eluser]kikz4life[/eluser]
Hi to all, I've been exploring more in CI framework community and i've bumped into this: http://ellislab.com/codeigniter/user-gui...ading.html. Its about uploading an image. Here is my help question how can i save the image file_name in the db. Could anyone show me the light? huhu. Cant figure out how can i call the file_name and insert it to the table field. Do i need to create a model in this? Code: <?php Thanks -Dean
[eluser]saidai jagan[/eluser]
U should rename the file, Because there ll be a mistake with same file names.. So u shd do like 17_thumb.jpg.where 17 is the user id who uploads the image.Thumb is the size
[eluser]kikz4life[/eluser]
i'll post the controller & view for quick response to all. controller Code: <?php View upload_form.php Code: <html>
[eluser]kikz4life[/eluser]
@saidai jagan i dont have to change the filename of image coz if ive uploaded same image its filename automatically increment (ie. pic.png then save again pic1.png.., pic2.png so on..) but how can i save the file_name to the database table field? could anyone show me a model for this? ( thanks in advance -Dean
[eluser]flaky[/eluser]
Code: if (!$this->upload->do_upload('upload_file')){
[eluser]kikz4life[/eluser]
hi there flaky thanks for the pointer, got it saved Thanks -Dean |
Welcome Guest, Not a member yet? Register Sign In |