I am using php on IIS7 to read data from a MSSQL database. One of the fields have a file path in it to an image file which I then need to access.
The problem is that the path has a mapped drive letter in it. I know I can access the file using the UNC name (i.e. "\\server\share\folder\file") but the users are accessing the drive as their W:\ drive, and so when they update the database, the field value ends up being "W:\folder\file", which php does not appear to be able to access. I assume this is because the user that php runs as (which according to phpinfo seems to be the computer account (i.e. "server$") does not have a drive mapping for W:\.
So while I could write a bit of code that took off the W:\ and replaced it with the UNC path, that isn't really bulletproof.
So my question is, does anyone know of a way to get a shared drive mapping into the profile of the php user, and can it be done safely? To be honest, I have got around this problem in the past by making W:\ a "real" drive on the server, so the local and mapped paths were identical, but I can't do this on this server.
Alternatively any other clever suggestions (and no, search and replace the values in the database is not an option).