I'm uploading images to a public 'uploads' folder, renaming the files to the ID of the file's entry in a MySQL table. So, because the IDs are in increasing order, anyone can download/view the images (some of which are supposed to be accessible only by some specific people). But I don't want anyone to be able to access the files by entering the URL.
One approach for this would be to upload the images somewhere other than the public directory, and then using each image's base64 code in the PHP script for the output. But this would increase the page load time.
What are alternatives to this problem? One would be to produce a hash using the crypt() function and rename the file, storing the file's name in a table.