Answered by:
FileStream: Access Denied when trying to write to NTFS location

Question
-
Technologies use:
Microsoft Visual Studio 2008 Version 9.0.30729, Microsoft .NET Framework Version 3.5 SP1.
SQL 2008 with FILESTREAM feature enabled.
Issue:
Getting Access Denied error in the .NET web service when upload image to SQL 2008 with FILESTREAM feature enabled.
The system returns the path of the NTFS location when execute the following command:
string Path = objSqlCmd.Parameters["@filepath"].Value.ToString();
Getting Access Denied error when execute the following command:
SqlFileStream objSqlFileStream = new SqlFileStream(Path, objContext, FileAccess.Write);
Web.Config:
<add name="connString" connectionString="Data Source=MAOPSQLDEV01;Initial Catalog=SBCATSWEB;Integrated Security = true;"/>
Wednesday, May 11, 2011 10:59 PM
Answers
-
a) change filesteram settings Allow remote clients to have streaming access to FILESTREAM data.
b) Make sure account under which your Web services are running (by default on IIS 7 it is network service account) has access to filestream tables
In SQL Server, FILESTREAM data is secured just like other data is secured: by granting permissions at the table or column levels. If a user has permission to the FILESTREAM column in a table, the user can open the associated files.
Thursday, May 12, 2011 12:36 AM -
Hello Tom,
Read the following Article Different ways to enable FILESTREAM feature of SQL Server 2008 which explains how to Allow remote clients to have streaming access to FILESTREAM data.
Also note you need to give Network Service account (used by IIS has access to SQL Server Database Tables which stores FILESTREAM data.
Hope that Helps!
Cheers,
Ashish Kumar MehtaPlease click the Mark as Answer button if a post solves your problem and Vote as Helpful if a Post is Helpful!
- Proposed as answer by Ashish Kumar Mehta Thursday, May 12, 2011 12:11 PM
- Marked as answer by Peja Tao Thursday, May 19, 2011 7:59 AM
Thursday, May 12, 2011 7:07 AM
All replies
-
a) change filesteram settings Allow remote clients to have streaming access to FILESTREAM data.
b) Make sure account under which your Web services are running (by default on IIS 7 it is network service account) has access to filestream tables
In SQL Server, FILESTREAM data is secured just like other data is secured: by granting permissions at the table or column levels. If a user has permission to the FILESTREAM column in a table, the user can open the associated files.
Thursday, May 12, 2011 12:36 AM -
Hello Tom,
Read the following Article Different ways to enable FILESTREAM feature of SQL Server 2008 which explains how to Allow remote clients to have streaming access to FILESTREAM data.
Also note you need to give Network Service account (used by IIS has access to SQL Server Database Tables which stores FILESTREAM data.
Hope that Helps!
Cheers,
Ashish Kumar MehtaPlease click the Mark as Answer button if a post solves your problem and Vote as Helpful if a Post is Helpful!
- Proposed as answer by Ashish Kumar Mehta Thursday, May 12, 2011 12:11 PM
- Marked as answer by Peja Tao Thursday, May 19, 2011 7:59 AM
Thursday, May 12, 2011 7:07 AM