Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Accessing a file stored in the DB folder

Accessing a file stored in the DB folder

Scheduled Pinned Locked Moved ASP.NET
databasehelpcsharpasp-netsysadmin
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    kroken
    wrote on last edited by
    #1

    I'm building a web application in ASP.NET which stores data in a database, and there also the sting to a picture stored outside the application root folder, in the DB/ProductPix folder. This works fine, but my problem occur when I try to show the image stored in the db folder. Can't find a way to get the riht path to the image. Tried to use different versions of this code in my aspx file: ![](C://domains//ApplicationName//db//ProductPix//<%# DataBinder.Eval(Container.DataItem, )" width="150"> There might be an easier way to store images on server (different folder etc), but since i figured out the DB folder is the only folder with Read/Write access. Correct me if I'm wrong! Hope someone can help me out ;) Thanks in advance!

    R 1 Reply Last reply
    0
    • K kroken

      I'm building a web application in ASP.NET which stores data in a database, and there also the sting to a picture stored outside the application root folder, in the DB/ProductPix folder. This works fine, but my problem occur when I try to show the image stored in the db folder. Can't find a way to get the riht path to the image. Tried to use different versions of this code in my aspx file: ![](C://domains//ApplicationName//db//ProductPix//<%# DataBinder.Eval(Container.DataItem, )" width="150"> There might be an easier way to store images on server (different folder etc), but since i figured out the DB folder is the only folder with Read/Write access. Correct me if I'm wrong! Hope someone can help me out ;) Thanks in advance!

      R Offline
      R Offline
      R Senthil Kumaran
      wrote on last edited by
      #2

      Hi, Its not like only in the db folder u can upload images u can do that at any folder untill its impersonated!! u can use the Request.PhysicallapplicationPath this will return u the pyhsical application path (note: application folder path not page folder path) say u r having your pictures running in c:\senthil\Mywebapp\picture\ the physicalapplicationpath will give u c:\senthil\Mywebapp\ this as out put from here you can map and go to the Picture Path so use as ![](<%# Request.PhysicalAppliationPath + @)" width="150"> I hope this will solve your problem!!:rose: Loving Code, R. Senthil Kumaran

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups