![]() |
storing images outside of public_html - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: storing images outside of public_html (/showthread.php?tid=16091) Pages:
1
2
|
storing images outside of public_html - El Forum - 02-28-2009 [eluser]samseko[/eluser] Hmm, got some ongoing issues related to this: With the use of the non-standard location for the images and this controller - i am finding it hard to include pagination. I was trying to integrate the pagination(s) within the main controller for the images i used above. If integrate the default ci pagination the integer appended to this url prompts me to save it ( integer ) as a file? Also tried integrating the ajax pagination, which in itself was loading the relevant page links, though no images were showing? storing images outside of public_html - El Forum - 02-28-2009 [eluser]TheFuzzy0ne[/eluser] I'm sorry, but I don't understand the problem. Pagination should have nothing to do with the images, but rather the pages that contain the images. The images themselves should be treated as single images. Can you show an example of what's not working? storing images outside of public_html - El Forum - 02-28-2009 [eluser]samseko[/eluser] When i use the ci pagination library and class, if i click on the pagination links created, it tries to append the link to the image loading part of the controller. That is, i get a download prompt for 'image//backend/members-section/10' This part is causing it, from what i can tell: 'header('Content-Type: image/'.$file_ext);' Here's the controller i have now: Code: function members_section($image_name="") storing images outside of public_html - El Forum - 02-28-2009 [eluser]TheFuzzy0ne[/eluser] The method used to request an image should be totally separate from pagination or anything else. The controller should simply validate the user, and return the requested image. Nothing else. No views, no pagination, nothing. Hope this helps. storing images outside of public_html - El Forum - 02-28-2009 [eluser]samseko[/eluser] I must be doing something wrong because I'm getting blank thumbnails again. Here is the controller code: Code: function members_section() Code: </img src="/backend/members_image/<? echo $row->thumbnail; ?>"> I am assuming that 'src="/backend/members_image/' would poll the relevant controller? storing images outside of public_html - El Forum - 02-28-2009 [eluser]TheFuzzy0ne[/eluser] You assume correctly. Check the HTML source, and ensure that the img src attribute is correctly set. If it is, try using the URL directly in the address bar to confirm it's working. If it's not, you may need to debug each line of your members_image method using log_message(), just to check that each line is producing the right results. storing images outside of public_html - El Forum - 02-28-2009 [eluser]samseko[/eluser] You're a LEGEND. The problem was URI Permissions. All good now, and the thumbs display! Sometimes, like in this situation, i should do obvious tests, rather than scratch my head wondering why the code don't work. storing images outside of public_html - El Forum - 02-28-2009 [eluser]TheFuzzy0ne[/eluser] I totally agree. Quite often you can actually do all the tests you need in less time than it takes to scratch your head whilst looking confused. Sadly, I still seem to spend too long doing the latter. I'm glad you got it sorted. ![]() |