• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
View image or pdf failure. How to redirect a page without avoiding server error ?

I have a grid on which 'View' button is shown. On clicking, it will open a pdf file to a new page. I used a anchor_popup function to do this. But If there is no such file exists or error in a file path, how do I avoid showing "server error" ? I tried to give a condition in which the view path if failed will take to 404_error.php, but that didn't seem to work.

Can anyone tell me is there any default method in CI to do this ?

Thanks in advance.

Approach 1: Your view could check for the file's existance before it puts the link on the screen, and display a friendly message if not found.

Approach 2: Your link could call a controller function passing in the file name, and the called function can check for the file existance.

Probably may other ways...

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.