无法从手机上的sharepoint 2010下载mp4,但非移动设备可以正常工作

时间:2012-08-28 20:49:37

标签: mobile sharepoint-2010 session-state

我们有一个SharePoint网站,其中包含一个专为网络和移动设计的自定义应用程序,我们正在尝试从SP2007升级到SP2010。该网站包含mp4文件的播放列表。我们在站点上激活了asp.net会话状态,以便在自定义应用程序中使用。我们还将网址重写为HTTPS。

文件存储在磁盘上,并通过虚拟目录访问。

当通过SP2010网站(非移动版)访问文件时,mp4文件播放正常。

如果从移动浏览器访问完全相同的网址,我们会收到以下消息:

Session state can only be used when enableSessionState is set to true, either in a
configuration file or in the Page directive. Please also make sure that
System.Web.SessionStateModule or a custom session state module is included in the
<configuration>\<system.web>\<httpModules> section in the application configuration.

我们在&lt; configuration&gt; \&lt; system.webServer&gt; \&lt; modules&gt;中声明了SessionStateModule。如下:

<add name="Session" type="System.Web.SessionState.SessionStateModule" preCondition="" />

我们也尝试过没有preCondition,并使用preCondition =“integratedMode”。

网址的一个示例是https://example.com/Assets/Job63/8f9e85d5-d7f3-4536-a9b1-69537b7da9bf/Previews/0568145f-b314-4354-a081-d72019a42d11.mp4(该网域已被更改以保护无辜者)。

虚拟目录是/ Assets,它指向c:\ Assets目录。

即使使用FireFox并更改用户代理以模拟移动设备,也会出现此问题,因此它似乎是拦截移动请求的内容。

网站上的其他会话状态答案似乎都没有解决此问题。

我们还在网站的IIS模块列表中声明了SessionStateModule。

可能导致此问题的原因是什么?

1 个答案:

答案 0 :(得分:0)

我们可以通过将包含以下内容的web.config文件放入assets文件夹来解决此问题。显然,SharePoint在SP2010中所做的积极的移动重定向会导致问题,如以下网址所述 - http://blog.mastykarz.nl/inconvenient-sharepoint-2010-mobile-redirect/

web.config内容:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <system.web>
    <browserCaps>
      <result type="System.Web.Mobile.MobileCapabilities, System.Web.Mobile, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
      <filter>isMobileDevice=false</filter>
    </browserCaps>
  </system.web>
</configuration>