westman Posted December 23, 2017 Share Posted December 23, 2017 How do I hide the image path so no user can see the name or folder that my image is in? Link to comment Share on other sites More sharing options...
dsonesuk Posted December 23, 2017 Share Posted December 23, 2017 You can't, but you can generate the same image as a php generated binary image. Link to comment Share on other sites More sharing options...
westman Posted December 24, 2017 Author Share Posted December 24, 2017 How? Link to comment Share on other sites More sharing options...
dsonesuk Posted December 24, 2017 Share Posted December 24, 2017 Here's a simplified example <img src="data:image/png;base64,<?php echo base64_encode(file_get_contents("../../image.jpg")) ?>" alt=""> It's base64 encoded, the original path won't be viewable, just the encoding of image. 1 Link to comment Share on other sites More sharing options...
westman Posted December 24, 2017 Author Share Posted December 24, 2017 lol that gave me the output of the longest url I have ever seen. Thank you. Question. Can it be decoded? Link to comment Share on other sites More sharing options...
dsonesuk Posted December 24, 2017 Share Posted December 24, 2017 Yes! but it will only be giving the image not the path to image as well, if someone wants to go through all that. Link to comment Share on other sites More sharing options...
westman Posted December 24, 2017 Author Share Posted December 24, 2017 Thank you so much. So so so helpful. Image security helps big time. Happy holidays Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now