Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Directory Name with Space

Status
Not open for further replies.

Miked811

Programmer
Apr 17, 2005
61
CA
Hi I am trying to display pictures from a folder with space,

e.g.: <img src=C:\MyWeb\Images\Pix One\Pix1.jpg>
This does not display the file

But if I make it like this:

e.g.: <img src=C:\MyWeb\Images\PixOne\Pix1.jpg>
This displays the file

Is there a way to display the file using "Pix One" directory with space, it is very important for my application.

Thanks
 
hi cris,

i actually have used them already:

Request.ServerVariables("APPL_PHYSICAL_PATH") & Folder

also

MapPath("Folder")

Where folder comes from a FSO Folders Collection to no avail...

thanks

 
sorry for not providing much of what I already have tried or done...

I already have tried your suggestion plus the Server.URLPathEncode() with and without quotes.

thanks
 
maybe you need to explain why you can't simply use src="/image/pix one/pic.jpg"

having physical paths in HTML source code is a real risk to the webserver security.


Chris.

Indifference will be the downfall of mankind, but who cares?
Woo Hoo! the cobblers kids get new shoes.
People Counting Systems

So long, and thanks for all the fish.
 
does Pix One directory exist? PixOne is there (therefore the image is displaying). why do u want to have a space???

Known is handfull, Unknown is worldfull
 
hi guys,

i am trying to mimic those photo gallery webhost.

...maybe you need to explain why you can't simply use src="/image/pix one/pic.jpg"

actually, the function uses the relative path which I showed above. when i use the servervariable and see what it looks like during execution, it showed me the physical path. i posted it as such for simplifying my query in this post.

...does Pix One directory exist? PixOne is there (therefore the image is displaying). why do u want to have a space???

i created a function that will display all the albums in the image directory, hence:

images
pix one
pix two
christmas party 2004
championship
etc...

given the above folder structure, i use the fso folders collection to display them. the folders display properly and the works for <a href> with urlencode. the parameters are passed properly to the page that should display the pictures, but no pictures are displayed. "pix one" or "pixone" exist. i rename the subfolder to isolate problems when using spaces and not. the subfolders with no spaces works fine with the function but those with space does not.

admin of the site will just create a subfolder in the image folder and upload the pictures using my webhost filemanager. i am still working on the upload utility for this site. i've been trying to get a directory "description" property (like fsoFolder.Description) but did not find one as a work around.

thanks
 
Ok the simplest way is to have the folders named as
christmas-party-2004 (for example) then use a function to get the folder name from HTTP_PATH_INFO and replace the "-" with " " for the caption. That's how all my page titles and headings are done on my site (in the sig)
Example Photo Gallery Template

for the photo gallery I did here ItsDownright there is a text file for each folder that has the caption in it and I use fso.readline to extract it.


Chris.

Indifference will be the downfall of mankind, but who cares?
Woo Hoo! the cobblers kids get new shoes.
People Counting Systems

So long, and thanks for all the fish.
 
thanks a lot for all your suggestion. i will try them all. you guys are the best. thanks again and more power....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top