Note that there are some explanatory texts on larger screens.

plurals
  1. POsecurely show images on website
    primarykey
    data
    text
    <p>I currently store a number of document preview images (jpg/tif) outside of my web root. There are 100s of them, so having this work efficiently is important. The reason they are stored outside of the web root is that they contain data the only specific users/user groups may view (but each user can have 100s of documents they can view).</p> <p>My current implementation is, when the user selects ‘view image’ an ajax call is triggered and this moves the image in question to a specific folder within the web root. The location is passed back and used to display the image to the user. When the next image is clicked, the call deletes any existing images and copies over the requested image. At session logout / timeout the users image folder is emptied. This has a few problems, but mainly:</p> <ol> <li>Files are constantly being copied and deleted</li> <li>There is the risk of images being left in the folder (issues with log off scripts)</li> <li>The whole time an images is in the folder it could be viewed by another users (unlikely but possible)</li> </ol> <p>Is there a better way of doing this? I looked at trying to combine the BinaryReader with the ajax call (as I hoped this would cut out the need to copy the files), but can’t see how to get the data back to be used by the JS in the calling page.</p> <p>Alternatively is there a way of making selected Folders only accessible to given users based on some session criteria? (I can’t imagine there is but I thought it’s worth asking.)</p> <p>So if anyone has any ideas on how this can be improved that would be great. This is a c# ASP.NET app using Jquery.</p> <p>Edit: The image is displayed using ajax, this allows for preloading and also means the rest of the page does not need to be reloaded when they select the next/previous image. It can almost be thought of as a javascript image swapper type situation, where the images are stored outside of the web root.</p> <p>Thanks.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload