Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Masking links

Is there a way that I can hide the name of an image file from the user so that they can't see what it's called, and infer anything from it? So if the real filename was something like bright01.gif the user would see something like image01101.gif where those numbers are randomly (or quasi-randomly) generated.

Thanks
There are two methods in software design. One is to make the program so simple, there are obviously no errors. The other is to make it so complicated, there are no obvious errors.

Comments

  • fzammettifzammetti Member Posts: 68
    There is no way that I can think of to hide a filename. Simple HTTP: a web page is requested and is returned to the browser. The browser parses the HTML and requests any images listed, then renders the results. Therefore, the HTML source has to include images as they appear on the server.

    Now, that being said, there ARE some things you could do that will be a bit more involved...

    (a) You could write some sort of request preprocessor that takes in a string in some special format and converts it to a real filename on your server. That way, the HTML source has some wacky-looking filename in it, your preprocessor translates it and returns the real file.

    (b) Something I did in a project some time ago... in your image tags, the src attibute does NOT have to point to an image file. It can instead point to a servlet. What you can do is something like:
    image. This will execute myServlet on your server. You grab the parameter fn, then decrypt it to get the real filename. Then you read the file and return it manually from the servlet (i.e., change the content type and write it out, byte for byte, to the response object's output stream). I had to do this because the environment I deployed an app to forced me to have images on a separate server from the rest of the app. Therefore, links didn't work propely. So, I had to do this to make it work. Should do the trick for you as well.

    : Is there a way that I can hide the name of an image file from the user so that they can't see what it's called, and infer anything from it? So if the real filename was something like bright01.gif the user would see something like image01101.gif where those numbers are randomly (or quasi-randomly) generated.
    :
    : Thanks
    : There are two methods in software design. One is to make the program so simple, there are obviously no errors. The other is to make it so complicated, there are no obvious errors.
    :

Sign In or Register to comment.