August 9, 2011 at 6:22 am
I am using FILESTREAM to store PDF documents in a table. I let the user select the PDF to store and then use this code to upload it:
UPDATE ClaimDocuments
SET doc_file = (SELECT BulkColumn FROM OPENROWSET(Bulk N'<<file name>>', SINGLE_BLOB) AS BLOB)
WHERE doc_PK = '<<document Primary Key>>'
The file is on the users PC in their My documents folder. The user is connected to the database using Windows authentication and the user has Bulk admin rights on the database. The SQL Server process is using the Network Service built in account.
I am assuming this is a problem with the Network Service not having read rights on the PC's folder where the file is being loaded from. How should I get around this?
August 9, 2011 at 6:45 am
error code 3 is actually 'The system cannot find the path specified' rather than a permissions error.
---------------------------------------------------------------------
August 9, 2011 at 6:59 am
Frank Cazabon (8/9/2011)
I am using FILESTREAM to store PDF documents in a table. I let the user select the PDF to store and then use this code to upload it:UPDATE ClaimDocuments
SET doc_file = (SELECT BulkColumn FROM OPENROWSET(Bulk N'<<file name>>', SINGLE_BLOB) AS BLOB)
WHERE doc_PK = '<<document Primary Key>>'
The file is on the users PC in their My documents folder. The user is connected to the database using Windows authentication and the user has Bulk admin rights on the database. The SQL Server process is using the Network Service built in account.
I am assuming this is a problem with the Network Service not having read rights on the PC's folder where the file is being loaded from. How should I get around this?
if the filename is using a drivename, ie C:\pathToFile\Filename, the file has to exist on the server.
if the filename is using a UNC path, like \\UserMachine\C$\PathToFile\filename, then the account that is running the SQL server Service needs access to that specific path.
if it's a shared mapped drive, like M:\ that is on a network share, the same issue above exists...mapped drives require an AD login, and the service running SQL might not have that
Lowell
August 9, 2011 at 7:08 am
Ah! Thanks, I'll see if I can convert the file name to a UNC and pass that instead
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply