Welcome Guest, Not a member yet? Register   Sign In
Restrict direct image viewing
#8

[eluser]Seppo[/eluser]
Hey, a small comment, the view method is reserved for php 4 so watch out that...

On the other side, you should use a file path - not an url path.
And you don't really need the gd library functions.
Code:
$path = BASEPATH . '../secret/2008/06/05/img_11.png'; // Correct the path if necesary but it has to be a local path
$mimetype = get_mime_by_extension($path); // will need file_helper loaded
header("Content-Type: ".$mimetype);
readfile($path);


Messages In This Thread
Restrict direct image viewing - by El Forum - 06-05-2008, 06:11 PM
Restrict direct image viewing - by El Forum - 06-06-2008, 12:28 AM
Restrict direct image viewing - by El Forum - 06-06-2008, 12:40 AM
Restrict direct image viewing - by El Forum - 06-06-2008, 01:05 AM
Restrict direct image viewing - by El Forum - 06-06-2008, 01:50 AM
Restrict direct image viewing - by El Forum - 06-06-2008, 01:14 PM
Restrict direct image viewing - by El Forum - 06-07-2008, 12:41 PM
Restrict direct image viewing - by El Forum - 06-07-2008, 06:18 PM
Restrict direct image viewing - by El Forum - 06-08-2008, 02:06 AM
Restrict direct image viewing - by El Forum - 06-09-2008, 02:17 AM
Restrict direct image viewing - by El Forum - 06-09-2008, 06:52 PM
Restrict direct image viewing - by El Forum - 06-09-2008, 08:09 PM
Restrict direct image viewing - by El Forum - 06-10-2008, 09:03 AM
Restrict direct image viewing - by El Forum - 06-10-2008, 10:58 AM



Theme © iAndrew 2016 - Forum software by © MyBB