Displaying Images ?

Discussion in 'ASP .Net' started by Vinay, Oct 24, 2003.

  1. Vinay

    Vinay Guest

    Hi All:

    I have a small application that stores images either in the database or as
    files (depending on the user preference). I'm in the process of providing a
    web interface to this application.

    1. If the images are stored in the DB then, every an image is requested, it
    will need to be pulled out and a temp file created and then displayed? What
    is the best way to do this?

    2. If the images are stored as files, how do I ensure security? For example
    if I store all the images in a folder called \database\images and that has a
    file 3.tif or 3.jpg, how do I ensure that people dont point their browsers
    to http://mysite/database/images/3.jpg ?

    Any pointers would be very helpful :)

    TIA

    Vinay
    am
    Vinay, Oct 24, 2003
    #1
    1. Advertising

  2. Vinay

    William Ryan Guest

    http://www.vbdotnetheaven.com/Code/Sept2003/2175.asp

    If you store them as Binary, then they'd have to query your database to hit
    the images and extract data from the stream. I think the above article
    should help you, but just check for BLOB and ADO.NEt on Google, there's tons
    of examples

    "Vinay" <> wrote in message
    news:...
    > Hi All:
    >
    > I have a small application that stores images either in the database or as
    > files (depending on the user preference). I'm in the process of providing

    a
    > web interface to this application.
    >
    > 1. If the images are stored in the DB then, every an image is requested,

    it
    > will need to be pulled out and a temp file created and then displayed?

    What
    > is the best way to do this?
    >
    > 2. If the images are stored as files, how do I ensure security? For

    example
    > if I store all the images in a folder called \database\images and that has

    a
    > file 3.tif or 3.jpg, how do I ensure that people dont point their browsers
    > to http://mysite/database/images/3.jpg ?
    >
    > Any pointers would be very helpful :)
    >
    > TIA
    >
    > Vinay
    > am
    >
    >
    William Ryan, Oct 24, 2003
    #2
    1. Advertising

  3. Vinay

    Vinay Guest

    Thanks for the lead.
    However if I want to save the images as files, do you have any pointers on
    how I can ensure that users will not be able to point their browsers to
    http://mysite/imagestore/imagename and have the image come up on the
    browser?

    Vinay

    "Vinay" <> wrote in message
    news:...
    > Hi All:
    >
    > I have a small application that stores images either in the database or as
    > files (depending on the user preference). I'm in the process of providing

    a
    > web interface to this application.
    >
    > 1. If the images are stored in the DB then, every an image is requested,

    it
    > will need to be pulled out and a temp file created and then displayed?

    What
    > is the best way to do this?
    >
    > 2. If the images are stored as files, how do I ensure security? For

    example
    > if I store all the images in a folder called \database\images and that has

    a
    > file 3.tif or 3.jpg, how do I ensure that people dont point their browsers
    > to http://mysite/database/images/3.jpg ?
    >
    > Any pointers would be very helpful :)
    >
    > TIA
    >
    > Vinay
    > am
    >
    >
    Vinay, Oct 24, 2003
    #3
  4. Vinay

    vMike Guest

    You could have your src=yourpictureroutine.aspx and have your aspx file do

    Response.ContentType = "image/jpeg"
    mynewimage.Save(Response.OutputStream, ImageFormat.Jpeg)

    Where mynewimage is a system.drawing.image from file. You could mask the
    file name or put the pictures in a non-www directory and do something like
    mynewimage=mgGetThumbNail(...)

    Function mgGetThumbNail(strFile as string, intWidth as integer, intHeight as
    integer) as system.drawing.image
    Dim myBitmap As bitmap = New Bitmap(strFile)
    return mybitmap.getthumbnailimage(intWidth,intHeight,nothing,nothing)
    End Function

    Someone can still right click the picture and save the thumbnail. But they
    won't be able to get the actual image file. If you want to keep a higher
    quality but smaller size you can use something like this.

    Function mgAdjustBitmap(strFile as string, intHorz as integer, intVert as
    integer) as bitmap
    Dim mysize as size = new size(inthorz,intVert)
    Dim myBitmap As bitmap = New Bitmap(strFile)
    myBitmap = new bitmap(mybitmap,mysize)
    return myBitmap 'myImg
    End Function


    Finally, once you have the image you can add text to the graphic using
    something like this (snip)

    dim objGraphic as Graphics = Graphics.FromImage(objBitmap)
    objGraphic.DrawString(strText,New Font("Tahoma",intFontSize),New
    SolidBrush(sysColor),intHorzPos, intVertPos)
    return objBitMap

    Hope this helps.
    I have heard that some people put clear transparent images over the page
    images so someone can't right click it but that seems to be a bit extreme.

    Hope this helps in some way.

    "Vinay" <> wrote in message
    news:...
    > Hi All:
    >
    > I have a small application that stores images either in the database or as
    > files (depending on the user preference). I'm in the process of providing

    a
    > web interface to this application.
    >
    > 1. If the images are stored in the DB then, every an image is requested,

    it
    > will need to be pulled out and a temp file created and then displayed?

    What
    > is the best way to do this?
    >
    > 2. If the images are stored as files, how do I ensure security? For

    example
    > if I store all the images in a folder called \database\images and that has

    a
    > file 3.tif or 3.jpg, how do I ensure that people dont point their browsers
    > to http://mysite/database/images/3.jpg ?
    >
    > Any pointers would be very helpful :)
    >
    > TIA
    >
    > Vinay
    > am
    >
    >
    vMike, Oct 24, 2003
    #4
  5. Vinay

    Vinay Guest

    Thanks for the pointers Mike.
    At the risk of sounding daft...what do you mean by?

    > You could have your src=yourpictureroutine.aspx and have your aspx file do


    Here's what I am trying to do:
    I have an aspx page that has a list box, that has lets say 3 entries. When
    the user clicks on each entry I want to show the corresponding image. These
    images could be big tif files or jpg files. I want to show these images in a
    new window. I've not worked a great deal with this before..hence the
    confusion on my part.

    Thanks!

    Vinay



    > Response.ContentType = "image/jpeg"
    > mynewimage.Save(Response.OutputStream, ImageFormat.Jpeg)
    >
    > Where mynewimage is a system.drawing.image from file. You could mask the
    > file name or put the pictures in a non-www directory and do something like
    > mynewimage=mgGetThumbNail(...)
    >
    > Function mgGetThumbNail(strFile as string, intWidth as integer, intHeight

    as
    > integer) as system.drawing.image
    > Dim myBitmap As bitmap = New Bitmap(strFile)
    > return mybitmap.getthumbnailimage(intWidth,intHeight,nothing,nothing)
    > End Function
    >
    > Someone can still right click the picture and save the thumbnail. But

    they
    > won't be able to get the actual image file. If you want to keep a higher
    > quality but smaller size you can use something like this.
    >
    > Function mgAdjustBitmap(strFile as string, intHorz as integer, intVert as
    > integer) as bitmap
    > Dim mysize as size = new size(inthorz,intVert)
    > Dim myBitmap As bitmap = New Bitmap(strFile)
    > myBitmap = new bitmap(mybitmap,mysize)
    > return myBitmap 'myImg
    > End Function
    >
    >
    > Finally, once you have the image you can add text to the graphic using
    > something like this (snip)
    >
    > dim objGraphic as Graphics = Graphics.FromImage(objBitmap)
    > objGraphic.DrawString(strText,New Font("Tahoma",intFontSize),New
    > SolidBrush(sysColor),intHorzPos, intVertPos)
    > return objBitMap
    >
    > Hope this helps.
    > I have heard that some people put clear transparent images over the page
    > images so someone can't right click it but that seems to be a bit extreme.
    >
    > Hope this helps in some way.
    >
    > "Vinay" <> wrote in message
    > news:...
    > > Hi All:
    > >
    > > I have a small application that stores images either in the database or

    as
    > > files (depending on the user preference). I'm in the process of

    providing
    > a
    > > web interface to this application.
    > >
    > > 1. If the images are stored in the DB then, every an image is requested,

    > it
    > > will need to be pulled out and a temp file created and then displayed?

    > What
    > > is the best way to do this?
    > >
    > > 2. If the images are stored as files, how do I ensure security? For

    > example
    > > if I store all the images in a folder called \database\images and that

    has
    > a
    > > file 3.tif or 3.jpg, how do I ensure that people dont point their

    browsers
    > > to http://mysite/database/images/3.jpg ?
    > >
    > > Any pointers would be very helpful :)
    > >
    > > TIA
    > >
    > > Vinay
    > > am
    > >
    > >

    >
    >
    Vinay, Oct 24, 2003
    #5
  6. Vinay

    vMike Guest

    I thought you where referring to images on the page. If you want images in a
    new window you probably want to do a response.redirect in the onclick event
    of the listbox. In that case you would not use the src= . That would only be
    used for images on the page. If you're openning a new window then your image
    is probably larger and higher quality. In that case, someone can just right
    click it and save it to their disk. I don't think there is much you can do
    about that. If you have a really high quality picture you can downgrade it
    using an aspx file that calls up the image and then makes it a thumbnail or
    smaller image using the info in my last post. You can also you a mask in
    your code so that the user does not know the actual file name of the image
    so they can't go back and try to get the base image. Hope this helps. There
    was a site that had some other ideas, I will try to find it and post a link
    when I get the chance.
    Here is some code I use for some of my pictures. This codes does not mask
    the file name but you could easily add it. Also if some of you file are tiff
    then you would need to build that into the content type. I snipped this so
    hopefully I got all the pieces.

    sub Page_Load(sender as object, e as eventArgs)

    dim strPic as string = request.querystring("_p")
    dim strDesigner as string = request.querystring("_d") & ""
    dim intWidth as int32 = ctype(request.querystring("_w"),int32)
    dim intHeight as int32 = ctype(request.querystring("_h"),int32)
    dim intQuality as int32 = ctype(request.querystring("_q"),int32)
    dim myNewImage as system.drawing.image
    dim intCacheTime as int32 = ctype(request.querystring("_c"),int32)
    if intCacheTime > 3600 then intCacheTime = 3600

    dim strFileLoc as string =
    server.mappath(configurationSettings.AppSettings("picroot"))
    Response.ContentType = "image/jpeg"
    if intCacheTime > 0 then
    Response.Cache.SetExpires(DateTime.Now.AddSeconds(intCacheTime))
    Response.Cache.SetCacheability(HttpCacheability.Public)
    Response.Cache.SetValidUntilExpires(True)
    Response.Cache.VaryByParams("_p") = True
    Response.Cache.VaryByParams("_h") = True
    Response.Cache.VaryByParams("_c") = True
    end if


    try
    select case intQuality
    case is = 1
    Dim bFlag as boolean = false
    if intWidth = 0 then intWidth = 200
    if intHeight = 0 then intHeight = 200
    if strDesigner.length > 0 then bFlag = true
    mynewimage = mgAdjustBitmap(strFileLoc & strPic, intWidth,
    intHeight,bFlag,strDesigner)
    case is = 2
    if intWidth = 0 then intWidth = 90
    if intHeight = 0 then intHeight = 90
    mynewimage = mggetthumbnail(strFileLoc & strPic,intWidth,intHeight)
    case is = 3
    if intWidth = 0 then intWidth = 90
    if intHeight = 0 then intHeight = 90
    mynewimage = mggetthumbnail(strFileLoc & strPic,intWidth,intHeight)
    dim strSaveLoc as string =
    server.mappath(configurationSettings.AppSettings("thumbroot"))
    mynewimage.save(strSaveLoc & strpic,ImageFormat.Jpeg)
    case is = 4
    if intWidth = 0 then intWidth = 90
    if intHeight = 0 then intHeight = 90
    mynewimage = mggetthumbnail(strFileLoc & strPic,intWidth,intHeight)
    dim strSaveLoc as string =
    server.mappath(configurationSettings.AppSettings("thumbroot"))
    mynewimage.save(strSaveLoc & strpic,ImageFormat.Jpeg)
    case else
    if intWidth = 0 then intWidth = 90
    if intHeight = 0 then intHeight = 90
    mynewimage = mggetthumbnail(strFileLoc & strPic,intWidth,intHeight)

    end select
    mynewimage.Save(Response.OutputStream, ImageFormat.Jpeg)
    mynewimage.dispose
    catch
    mynewimage= mggetthumbnail(strFileLoc & "npicture.jpg",240,180)

    mynewimage.Save(Response.OutputStream, ImageFormat.Jpeg)
    mynewimage.dispose
    end try
    End Sub

    Function mgGetThumbNail(strFile as string, intWidth as integer, intHeight as
    integer) as system.drawing.image
    Dim myBitmap As bitmap = New Bitmap(strFile)
    return mybitmap.getthumbnailimage(intWidth,intHeight,nothing,nothing)
    End Function

    Function mgAdjustBitmap(strFile as string, intHorz as integer, intVert as
    integer,bDrawTextFlag as boolean, strText as string) as bitmap

    Dim mysize as size = new size(inthorz,intVert)
    Dim myBitmap As bitmap = New Bitmap(strFile)
    myBitmap = new bitmap(mybitmap,mysize)
    if bDrawTextFlag then
    myBitmap = mgDrawText(myBitmap, strText, 8,
    color.blue,ctype(intHorz*.05,int32),ctype(intVert * .92,int32))
    end if


    return myBitmap
    End Function

    Function mgDrawText(objBitmap as bitmap, strText as string, intFontSize as
    int32, sysColor as color, intHorzPos as int32, intVertPos as int32) as
    bitmap
    dim objGraphic as Graphics = Graphics.FromImage(objBitmap)
    objGraphic.DrawString(strText,New Font("Tahoma",intFontSize),New
    SolidBrush(sysColor),intHorzPos, intVertPos)
    return objBitMap
    End Function



    "Vinay" <> wrote in message
    news:%23DVdo%...
    > Thanks for the pointers Mike.
    > At the risk of sounding daft...what do you mean by?
    >
    > > You could have your src=yourpictureroutine.aspx and have your aspx file

    do
    >
    > Here's what I am trying to do:
    > I have an aspx page that has a list box, that has lets say 3 entries. When
    > the user clicks on each entry I want to show the corresponding image.

    These
    > images could be big tif files or jpg files. I want to show these images in

    a
    > new window. I've not worked a great deal with this before..hence the
    > confusion on my part.
    >
    > Thanks!
    >
    > Vinay
    >
    >
    >
    > > Response.ContentType = "image/jpeg"
    > > mynewimage.Save(Response.OutputStream, ImageFormat.Jpeg)
    > >
    > > Where mynewimage is a system.drawing.image from file. You could mask the
    > > file name or put the pictures in a non-www directory and do something

    like
    > > mynewimage=mgGetThumbNail(...)
    > >
    > > Function mgGetThumbNail(strFile as string, intWidth as integer,

    intHeight
    > as
    > > integer) as system.drawing.image
    > > Dim myBitmap As bitmap = New Bitmap(strFile)
    > > return mybitmap.getthumbnailimage(intWidth,intHeight,nothing,nothing)
    > > End Function
    > >
    > > Someone can still right click the picture and save the thumbnail. But

    > they
    > > won't be able to get the actual image file. If you want to keep a higher
    > > quality but smaller size you can use something like this.
    > >
    > > Function mgAdjustBitmap(strFile as string, intHorz as integer, intVert

    as
    > > integer) as bitmap
    > > Dim mysize as size = new size(inthorz,intVert)
    > > Dim myBitmap As bitmap = New Bitmap(strFile)
    > > myBitmap = new bitmap(mybitmap,mysize)
    > > return myBitmap 'myImg
    > > End Function
    > >
    > >
    > > Finally, once you have the image you can add text to the graphic using
    > > something like this (snip)
    > >
    > > dim objGraphic as Graphics = Graphics.FromImage(objBitmap)
    > > objGraphic.DrawString(strText,New Font("Tahoma",intFontSize),New
    > > SolidBrush(sysColor),intHorzPos, intVertPos)
    > > return objBitMap
    > >
    > > Hope this helps.
    > > I have heard that some people put clear transparent images over the page
    > > images so someone can't right click it but that seems to be a bit

    extreme.
    > >
    > > Hope this helps in some way.
    > >
    > > "Vinay" <> wrote in message
    > > news:...
    > > > Hi All:
    > > >
    > > > I have a small application that stores images either in the database

    or
    > as
    > > > files (depending on the user preference). I'm in the process of

    > providing
    > > a
    > > > web interface to this application.
    > > >
    > > > 1. If the images are stored in the DB then, every an image is

    requested,
    > > it
    > > > will need to be pulled out and a temp file created and then displayed?

    > > What
    > > > is the best way to do this?
    > > >
    > > > 2. If the images are stored as files, how do I ensure security? For

    > > example
    > > > if I store all the images in a folder called \database\images and that

    > has
    > > a
    > > > file 3.tif or 3.jpg, how do I ensure that people dont point their

    > browsers
    > > > to http://mysite/database/images/3.jpg ?
    > > >
    > > > Any pointers would be very helpful :)
    > > >
    > > > TIA
    > > >
    > > > Vinay
    > > > am
    > > >
    > > >

    > >
    > >

    >
    >
    vMike, Oct 24, 2003
    #6
  7. Vinay

    Vinay Guest

    Mike:

    Thanks - the code will certainly help me understand how I can go about
    trying to do what I need to do. Appreciate you taking the time to help :)

    Vinay

    "vMike" <> wrote in message
    news:bnc34h$sis$...
    > I thought you where referring to images on the page. If you want images in

    a
    > new window you probably want to do a response.redirect in the onclick

    event
    > of the listbox. In that case you would not use the src= . That would only

    be
    > used for images on the page. If you're openning a new window then your

    image
    > is probably larger and higher quality. In that case, someone can just

    right
    > click it and save it to their disk. I don't think there is much you can do
    > about that. If you have a really high quality picture you can downgrade it
    > using an aspx file that calls up the image and then makes it a thumbnail

    or
    > smaller image using the info in my last post. You can also you a mask in
    > your code so that the user does not know the actual file name of the image
    > so they can't go back and try to get the base image. Hope this helps.

    There
    > was a site that had some other ideas, I will try to find it and post a

    link
    > when I get the chance.
    > Here is some code I use for some of my pictures. This codes does not mask
    > the file name but you could easily add it. Also if some of you file are

    tiff
    > then you would need to build that into the content type. I snipped this so
    > hopefully I got all the pieces.
    >
    > sub Page_Load(sender as object, e as eventArgs)
    >
    > dim strPic as string = request.querystring("_p")
    > dim strDesigner as string = request.querystring("_d") & ""
    > dim intWidth as int32 = ctype(request.querystring("_w"),int32)
    > dim intHeight as int32 = ctype(request.querystring("_h"),int32)
    > dim intQuality as int32 = ctype(request.querystring("_q"),int32)
    > dim myNewImage as system.drawing.image
    > dim intCacheTime as int32 = ctype(request.querystring("_c"),int32)
    > if intCacheTime > 3600 then intCacheTime = 3600
    >
    > dim strFileLoc as string =
    > server.mappath(configurationSettings.AppSettings("picroot"))
    > Response.ContentType = "image/jpeg"
    > if intCacheTime > 0 then
    > Response.Cache.SetExpires(DateTime.Now.AddSeconds(intCacheTime))
    > Response.Cache.SetCacheability(HttpCacheability.Public)
    > Response.Cache.SetValidUntilExpires(True)
    > Response.Cache.VaryByParams("_p") = True
    > Response.Cache.VaryByParams("_h") = True
    > Response.Cache.VaryByParams("_c") = True
    > end if
    >
    >
    > try
    > select case intQuality
    > case is = 1
    > Dim bFlag as boolean = false
    > if intWidth = 0 then intWidth = 200
    > if intHeight = 0 then intHeight = 200
    > if strDesigner.length > 0 then bFlag = true
    > mynewimage = mgAdjustBitmap(strFileLoc & strPic, intWidth,
    > intHeight,bFlag,strDesigner)
    > case is = 2
    > if intWidth = 0 then intWidth = 90
    > if intHeight = 0 then intHeight = 90
    > mynewimage = mggetthumbnail(strFileLoc & strPic,intWidth,intHeight)
    > case is = 3
    > if intWidth = 0 then intWidth = 90
    > if intHeight = 0 then intHeight = 90
    > mynewimage = mggetthumbnail(strFileLoc & strPic,intWidth,intHeight)
    > dim strSaveLoc as string =
    > server.mappath(configurationSettings.AppSettings("thumbroot"))
    > mynewimage.save(strSaveLoc & strpic,ImageFormat.Jpeg)
    > case is = 4
    > if intWidth = 0 then intWidth = 90
    > if intHeight = 0 then intHeight = 90
    > mynewimage = mggetthumbnail(strFileLoc & strPic,intWidth,intHeight)
    > dim strSaveLoc as string =
    > server.mappath(configurationSettings.AppSettings("thumbroot"))
    > mynewimage.save(strSaveLoc & strpic,ImageFormat.Jpeg)
    > case else
    > if intWidth = 0 then intWidth = 90
    > if intHeight = 0 then intHeight = 90
    > mynewimage = mggetthumbnail(strFileLoc & strPic,intWidth,intHeight)
    >
    > end select
    > mynewimage.Save(Response.OutputStream, ImageFormat.Jpeg)
    > mynewimage.dispose
    > catch
    > mynewimage= mggetthumbnail(strFileLoc & "npicture.jpg",240,180)
    >
    > mynewimage.Save(Response.OutputStream, ImageFormat.Jpeg)
    > mynewimage.dispose
    > end try
    > End Sub
    >
    > Function mgGetThumbNail(strFile as string, intWidth as integer, intHeight

    as
    > integer) as system.drawing.image
    > Dim myBitmap As bitmap = New Bitmap(strFile)
    > return mybitmap.getthumbnailimage(intWidth,intHeight,nothing,nothing)
    > End Function
    >
    > Function mgAdjustBitmap(strFile as string, intHorz as integer, intVert as
    > integer,bDrawTextFlag as boolean, strText as string) as bitmap
    >
    > Dim mysize as size = new size(inthorz,intVert)
    > Dim myBitmap As bitmap = New Bitmap(strFile)
    > myBitmap = new bitmap(mybitmap,mysize)
    > if bDrawTextFlag then
    > myBitmap = mgDrawText(myBitmap, strText, 8,
    > color.blue,ctype(intHorz*.05,int32),ctype(intVert * .92,int32))
    > end if
    >
    >
    > return myBitmap
    > End Function
    >
    > Function mgDrawText(objBitmap as bitmap, strText as string, intFontSize as
    > int32, sysColor as color, intHorzPos as int32, intVertPos as int32) as
    > bitmap
    > dim objGraphic as Graphics = Graphics.FromImage(objBitmap)
    > objGraphic.DrawString(strText,New Font("Tahoma",intFontSize),New
    > SolidBrush(sysColor),intHorzPos, intVertPos)
    > return objBitMap
    > End Function
    >
    >
    >
    > "Vinay" <> wrote in message
    > news:%23DVdo%...
    > > Thanks for the pointers Mike.
    > > At the risk of sounding daft...what do you mean by?
    > >
    > > > You could have your src=yourpictureroutine.aspx and have your aspx

    file
    > do
    > >
    > > Here's what I am trying to do:
    > > I have an aspx page that has a list box, that has lets say 3 entries.

    When
    > > the user clicks on each entry I want to show the corresponding image.

    > These
    > > images could be big tif files or jpg files. I want to show these images

    in
    > a
    > > new window. I've not worked a great deal with this before..hence the
    > > confusion on my part.
    > >
    > > Thanks!
    > >
    > > Vinay
    > >
    > >
    > >
    > > > Response.ContentType = "image/jpeg"
    > > > mynewimage.Save(Response.OutputStream, ImageFormat.Jpeg)
    > > >
    > > > Where mynewimage is a system.drawing.image from file. You could mask

    the
    > > > file name or put the pictures in a non-www directory and do something

    > like
    > > > mynewimage=mgGetThumbNail(...)
    > > >
    > > > Function mgGetThumbNail(strFile as string, intWidth as integer,

    > intHeight
    > > as
    > > > integer) as system.drawing.image
    > > > Dim myBitmap As bitmap = New Bitmap(strFile)
    > > > return mybitmap.getthumbnailimage(intWidth,intHeight,nothing,nothing)
    > > > End Function
    > > >
    > > > Someone can still right click the picture and save the thumbnail. But

    > > they
    > > > won't be able to get the actual image file. If you want to keep a

    higher
    > > > quality but smaller size you can use something like this.
    > > >
    > > > Function mgAdjustBitmap(strFile as string, intHorz as integer, intVert

    > as
    > > > integer) as bitmap
    > > > Dim mysize as size = new size(inthorz,intVert)
    > > > Dim myBitmap As bitmap = New Bitmap(strFile)
    > > > myBitmap = new bitmap(mybitmap,mysize)
    > > > return myBitmap 'myImg
    > > > End Function
    > > >
    > > >
    > > > Finally, once you have the image you can add text to the graphic using
    > > > something like this (snip)
    > > >
    > > > dim objGraphic as Graphics = Graphics.FromImage(objBitmap)
    > > > objGraphic.DrawString(strText,New Font("Tahoma",intFontSize),New
    > > > SolidBrush(sysColor),intHorzPos, intVertPos)
    > > > return objBitMap
    > > >
    > > > Hope this helps.
    > > > I have heard that some people put clear transparent images over the

    page
    > > > images so someone can't right click it but that seems to be a bit

    > extreme.
    > > >
    > > > Hope this helps in some way.
    > > >
    > > > "Vinay" <> wrote in message
    > > > news:...
    > > > > Hi All:
    > > > >
    > > > > I have a small application that stores images either in the database

    > or
    > > as
    > > > > files (depending on the user preference). I'm in the process of

    > > providing
    > > > a
    > > > > web interface to this application.
    > > > >
    > > > > 1. If the images are stored in the DB then, every an image is

    > requested,
    > > > it
    > > > > will need to be pulled out and a temp file created and then

    displayed?
    > > > What
    > > > > is the best way to do this?
    > > > >
    > > > > 2. If the images are stored as files, how do I ensure security? For
    > > > example
    > > > > if I store all the images in a folder called \database\images and

    that
    > > has
    > > > a
    > > > > file 3.tif or 3.jpg, how do I ensure that people dont point their

    > > browsers
    > > > > to http://mysite/database/images/3.jpg ?
    > > > >
    > > > > Any pointers would be very helpful :)
    > > > >
    > > > > TIA
    > > > >
    > > > > Vinay
    > > > > am
    > > > >
    > > > >
    > > >
    > > >

    > >
    > >

    >
    >
    Vinay, Oct 24, 2003
    #7
  8. Vinay

    vMike Guest

    Here a link to a site that has some other idea.

    http://www.htmlite.com/faq010.php

    "Vinay" <> wrote in message
    news:...
    > Hi All:
    >
    > I have a small application that stores images either in the database or as
    > files (depending on the user preference). I'm in the process of providing

    a
    > web interface to this application.
    >
    > 1. If the images are stored in the DB then, every an image is requested,

    it
    > will need to be pulled out and a temp file created and then displayed?

    What
    > is the best way to do this?
    >
    > 2. If the images are stored as files, how do I ensure security? For

    example
    > if I store all the images in a folder called \database\images and that has

    a
    > file 3.tif or 3.jpg, how do I ensure that people dont point their browsers
    > to http://mysite/database/images/3.jpg ?
    >
    > Any pointers would be very helpful :)
    >
    > TIA
    >
    > Vinay
    > am
    >
    >
    vMike, Oct 25, 2003
    #8
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. David J. Berman
    Replies:
    0
    Views:
    1,411
    David J. Berman
    Jun 24, 2003
  2. Matt
    Replies:
    0
    Views:
    383
  3. =?Utf-8?B?SmltIE1hY2U=?=

    Displaying images from a database in an image control

    =?Utf-8?B?SmltIE1hY2U=?=, May 5, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    383
    Ashish M Bhonkiya
    May 5, 2004
  4. Ken Varn
    Replies:
    2
    Views:
    561
    Ken Varn
    May 11, 2004
  5. TXIce

    Images not displaying in designer

    TXIce, Dec 31, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    377
    =?Utf-8?B?UHJha2FzaC5ORVQ=?=
    Dec 31, 2004
Loading...

Share This Page