Results 1 to 6 of 6

Thread: create temporary images??

  1. #1

    Thread Starter
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428

    create temporary images??

    I dont know if this would make sense but I would appreciate if someone gives me some info on it. I want to show an image to the user but I don't want the user to be able to save the URL of that image and view it later on. Is there any way that I could load an image into a HTML page without giving away its URL on the server?

    I've also noticed that sometimes when you view the source of an image on a website it's just a link to a server-side page with a query string. For example the link to my avtar is http://www.vbforums.com/avatar.php?userid=22277&dateline=1022378610. That's just a link to a php page instead of a link to a GIF file. How does a serverside page serve an image like that?
    help this idiot out please
    Last edited by MrPolite; Jul 13th, 2004 at 02:58 AM.
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  2. #2
    Frenzied Member dj4uk's Avatar
    Join Date
    Aug 2002
    Location
    Birmingham, UK Lobotomies: 3
    Posts
    1,131
    Firstly rather than saving the URL and viewing it later most people will right click and save the full image locally.

    You can use server-side scripts to display images according to various input parameters by creating a byte stream to the users browser and setting the content-type in the HTTP header to be whatever file type you are streaming.

    Quite often when you see this done the file is stored in a database in a BLOB (Binary Large OBject) field and therefore needs to be streamed to the browser as there isn't actually a physical path to the file.

    It could be possible to create a "temporary" image by passing in a date to a server-side script that checks it is within a certain timespan before streaming the image. Savvy users might spot this and be able to change the date/time passed in.

    Let me know if you need to know anything else.

    HTH

    DJ

  3. #3
    Addicted Member
    Join Date
    Nov 2001
    Location
    Yewston, Texis
    Posts
    240
    It's probably not feasible to prevent a determined user from acquiring the image. One thing that would help is to embed the image into a flash movie and display the movie instead of the image. Flash is pretty efficient, so the final file needn't be much larger than the original image. Trying to save a flash file from I.E., is a bit of a pain, plus it would be hard to use the image for anything else unless you got a flash decompiler.

    Also, there are ways to automatically generate flash "movies" (they don't always move) on the fly by the web server. Not sure about how this might be done in a .NET environment, but do a search on Ming for Apache. If worse came to worse, you could co-exist IIS and Apache on the same server. (Ming + Apache being free, of course)

    cudabean

  4. #4

    Thread Starter
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    thanks for the ideas guys. For now I'm just doing this: There is an asp page that gets an image id from the query string. I just write the image back using Response.WriteFile()... I don't know if this is the correct way but it seems to be working. Now I just need to check the refferal url and make sure they are not coming from another website. If the refferal url is from some other website then it wouldnt show the image. works fine with me
    I think I'm ok with the users saving the images to their harddrive. I was mainly concerned about linking to my webserver (for some top-secret reason )

    hmm now how would I go about checking the refferal url?
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  5. #5
    I wonder how many charact
    Join Date
    Feb 2001
    Location
    Savage, MN, USA
    Posts
    3,704
    Mr. Polite, that is the correct way, and really only way to handle that situation! The Flash idea was unique for sure, but you cannot guarantee a client has it.

    The referURl is available through
    VB Code:
    1. Page.Request.UrlReferrer.PathAndQuery

  6. #6
    Frenzied Member dj4uk's Avatar
    Join Date
    Aug 2002
    Location
    Birmingham, UK Lobotomies: 3
    Posts
    1,131
    Response.WriteFile() should work fine as long as the images aren't too large (I'm talking over 10Mb here) - it gets a little inefficient on the server memory.

    I can supply code to break the streaming down into chunks if are are using very large files - just give me a shout if you want it.

    DJ

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width