A # sign in filenames is causing an issue with url.
Posted on 2013-11-14
I've got a little php script which reads the files in a directory then creates and displays it as a link to the file in a web page. Example; a file in the directory is named abcdef.pdf, so my script reads that and writes <a href="abdcef.pdf">abcdef.pdf</a>. Here's the issue, on this particular Unix server some of the file names include a # sign and spaces, like abc# def.pdf. The spaces aren't an issue but that # sign sure is. Does anyone know if there's a way to include a # sign in the url without it being some sort of instruction to the browser? I'll keep googling. Again, this is on a SCO Openserver 6 Unix server running apache webserver. I suppose I could talk to the customer about renaming the ~3000 files with a # in the name.