FSO object and spaces in file names
Posted on 2004-08-19
Good Morning all!!
I am using the FSO object to read in files that are included in a folder and then turning around and spitting them out as hyper links.
Once the user clicks on the links I am passing the file name in the query string as I reload the page for the next step in processing.
Here is the problem. If I have spaces in the file name (as most of our docs do) then when I read in the file the name is being truncated at the first space. I have searched the web and EE for a resolution and other then re-writing my code to use the GetFile method rather then the GetFolder method I am not sure how to read in the files in the folder that have spaces in them.
Here is a snippet of my code:
Set fso = CreateObject("Scripting.FileSystemObject")
Set folder = fso.GetFolder(fileloc)
Set files = folder.Files
For Each file in files
redim preserve dir2(i)
redim preserve dir3(i)
redim preserve dir4(i)
i = i + 1
As an aside... I know I could use a multi dimensional array rather then 3 different ones but I added them in at different times and this was easier :-/