protect browser access image file

Hi,

I would like to find a solution to this problem:

Users upload image on my application,

I save original (ex. image_name_original.jpg )

and image with logo (ex image_name.jpg).

So in future I can change app logo.

Now my question is: How I can protect (forbid browser access) the original images

Thanks in advance

Deny outside access to the folder with original images using server configuration or save images in folder outside the public access and serve them using php methods.

You could save the original images in a separate subfolder

and then in that subfolder you create a .htaccess file with directive:

deny from all

This way the images are forbidden for browsers, but accessible for your webapp.