从IIS访问SQL Server FileTable [英] Access to SQL Server FileTable from IIS

查看:73
本文介绍了从IIS访问SQL Server FileTable的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

创建文件表后,我有一个共享文件夹 \\<我的域> \ mssqlserver \<文件流目录> \<我的表> 我已经在SqlServer配置管理器中进行了所有必要的设置,以使其可用,并使用数据库存储的proc添加了几个文件.

After creating filetable I've got a shared folder \\<my domain>\mssqlserver\<filestream directory>\<my table> I've made all nesessary settings in SqlServer Configuration manager to make it available and added couple of files with database stored proc.

我为网站制作了虚拟文件夹 http://localhost/<我的ewb网站>/<虚拟文件夹>/引用共享表文件夹.

I made virtual folder for my web site http://localhost/<my ewb site>/<virtual folder>/ referencing shared table folder.

当我尝试从文件夹中获取文件时,出现错误:HTTP 500.19-内部服务器错误代码0x80070032

When I try to get file from folder I get en error: HTTP 500.19 - Internal Server Error Code 0x80070032

我在回答这个问题时发现了一些东西将文件插入到文件中时拒绝访问在ASP.NET网站中使用File.CreateFile的Sql Server 2012 FileTable

I found something in answer of this question Access Denied when inserting file into Sql Server 2012 FileTable using File.CreateFile in ASP.NET website

但这只是配置的数据库部分.我不明白如何配置IIS和虚拟文件夹以授予对共享文件夹的访问权限.

But it's only a database part of configuring. I don't understand how to configure IIS and virtual folder to grant access to shared folder.

推荐答案

不确定这是否与您的情况有关,但我遇到了相同的问题.我设置的3个站点中有2个可以在指向SQL文件表共享的UNC路径虚拟目录下正常工作,但是第3个站点出现了以上错误.原因是因为此站点在同一服务器上同时具有IIS和SQL,并且在UNC路径中使用服务器名称会导致重新解析并检查目录更改通知,SQL不支持以上注释中提到的通知.因此,我将UNC路径更改为使用localhost而不是服务器名称,它起作用了!因此,代替:

Not sure if this is relevant to your situation, but I came across the same problem. 2 out of 3 sites that I setup worked fine with the UNC path virtual directory pointing to the SQL filetable share, but the 3rd site got the error above. The reason was because this site was had both IIS and SQL on the same server, and using the server name in the UNC path was causing a reparse and checking for directory change notifications, which mentioned in the comments above aren't supported by SQL. So I changed the UNC path to use localhost instead of the server name and it worked! So, instead of:

\\<my domain>\mssqlserver\<filestream directory>\<my table>

使用:

\\localhost\mssqlserver\<filestream directory>\<my table>

这篇关于从IIS访问SQL Server FileTable的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆