I need to create a link to a file that is located on the same server as Domino but outside of the Database. The file I need to create a link to is modified everynight by an agent.
All I need to do is create a link to download the file, either by text link or a button. I have tried everythig I can think of, with no success.
When I try "file://servername/drivenameOrDirectory/path/filename.ext ", it does not work. I have tried many combination of the “file:” command with no success.
The file path I need to link to is “c:\ExportData\ExportData.csv”. My web site host name is the IP address (xx.xx.xx.xx). If someone could show me a sample of how to code this into a button or text link I would greatly appreciate it!
This is a result of the security model of the Domino http server: The only kinds of files which are served/exposed/accessible via the explicit path to the file are databases. (With the fairly-recently-added exception that .NTFs are no longer served by the http server at all as an attempt to make Domino more secure even when you have no idea how to set it up correctly.)
All other files must be placed in directories which have an explicit url-to-directory mapping created for them. Files in these directories are accessible not via the actual path to the file, but by the url you make up as a “shortcut” to get there. You get three url-to-directory mappings for free when you start the http server:
The missing url that maps to the domino\html directory path is just “/” – which is why Dima told you that you can access the file via “/filename.ext” if you put it in that directory. But you could also put it in either of the other two directories and access it from their mapped urls – or you can change any of these directory names or urls so that your server is not configured the same way as everyone else’s – or you can put your files in a completely different directory (under the main data directory, not outside the data path) and create your own url-to-directory mapping in one of the two ways indicated in this posting.
Overall, though, as of R5 (and especially as of R6), you can put your files inside a database as file resources (in R5 you had to kludge it, but it could be done – it just wasn’t documented) and then access them with a url based off the database url; /path/db.nsf/filename.ext. This has the added benefit of applying normal Domino security measures to the files – like ACLs, Readers fields, and $PublicAccess fields – instead of requiring the use of File Protection documents. I am assuming that you know about this method of storing/serving files, and that you need the file in question to be accessible to some non-Domino process or you have some other specific reason to want it out on the file system instead of safely tucked away inside an NSF file.
I’d be more than happy to help you out on that if you’re interested… My name is Thomas Duff (“Duffbert”), and I’m the tech editor for the e-ProWire: Lotus Developer Tips newsletter. If you’re interested in looking into article writing a bit more, send me an email at duffbert AT gmail.com. I’m always looking for good material (and if Ben thinks it’s good, it’s good!)…