Welcome Guest, Not a member yet? Register   Sign In
View image or pdf failure. How to redirect a page without avoiding server error ?
#1

[eluser]quest13[/eluser]
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.
#2

[eluser]bigtony[/eluser]
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...




Theme © iAndrew 2016 - Forum software by © MyBB