J
Jerry
I'm having just a bit of trouble wrapping my brain around the task of
working with folders that are above the site's root folder.
I let users upload photos (.jpg/.gif files) which can subsequently be viewed
on the site's pages. My hosting provider is requiring that any files my Web
app writes get written to a folder that is above the app's root folder (for
security purposes).
When writing the files I understand how to use MapPath to get the physical
path to the destination folder. So I think I'm okay on the uploading part.
But what I'm kind of hung up on is how to get my the aspx pages (<IMG
src=...>) to refer to the files in that folder. I'm dynamically assigning
the value of the src= property of IMG controls.
Do I need to create a virtual folder in the site? Is that the solution? Is
there another/better way? If I create a virtual folder, can I then ditch the
use of MapPath for uploading the files? Suppose I get all this to work with
a virtual folder, then haven't we totally defeated the whole point of
placing the folder above the site root (for security purposes)?
Bottom line - what do I need to do?
I'm kind of new Web app development, so any guidance or perspective is
greatly appreciated.
working with folders that are above the site's root folder.
I let users upload photos (.jpg/.gif files) which can subsequently be viewed
on the site's pages. My hosting provider is requiring that any files my Web
app writes get written to a folder that is above the app's root folder (for
security purposes).
When writing the files I understand how to use MapPath to get the physical
path to the destination folder. So I think I'm okay on the uploading part.
But what I'm kind of hung up on is how to get my the aspx pages (<IMG
src=...>) to refer to the files in that folder. I'm dynamically assigning
the value of the src= property of IMG controls.
Do I need to create a virtual folder in the site? Is that the solution? Is
there another/better way? If I create a virtual folder, can I then ditch the
use of MapPath for uploading the files? Suppose I get all this to work with
a virtual folder, then haven't we totally defeated the whole point of
placing the folder above the site root (for security purposes)?
Bottom line - what do I need to do?
I'm kind of new Web app development, so any guidance or perspective is
greatly appreciated.