http head scratcher

Mike Novak prx000 at mail.connect.more.net
Fri Jun 1 12:02:05 EDT 2001


Greetings folks,

Our director wanted me to put our policy documents up on a staff intranet
(basically a web page IP restritricted) so I whipped up a script (using
VBScript, which I like quite a bit) to create a dynamic page with links to
the Word documents in a server directory.  The thing was, the file names had
spaces in them, i.e. "Disruptive behavior.doc".  I wanted to have the page
created on the fly so she could just dump additional files into the
directory without my having to add new links to the web page.  We're an NT
environment running IIS 4.0.  Obviously a URL with a space won't work, so I
tried converting the space in the URL to a % (i.e.
"Disruptive%behavior.doc") which seems to work other places but didn't work
in this case.  Then I tried using the "short name" (i.e. "Disrup~1.doc",
which is available from a method of the file system object.  I figured since
it was all Microsoft, it should work.  But it didn't!  So finally I settled
on converting the spaces in the filenames to underscores by hand, then
having the script display the filename converting the underscore to a space
and knocking off the extension, creating a nice unordered list.  Anyway, is
there a way I could have kept the spaces in the filenames and still linked
to them from the web?  (I wouldn't put spaces in the filenames in the
firstplace, but that's another story :) )

Thanks,
Mike Novak
Technology Coordinator & Reference Librarian
University City Public Library



More information about the Web4lib mailing list