Search code examples
javascriptjquerysharepoint-2010custom-action

Sharepoint 2010 Sandboxed Solution File hosting - display results in download


I put some files inside a Module for a Sharepoint 2010 sandboxed solution. there is a html file i want to display. for that i added a custom action button to the taskbar.

I'm executing some javascript for that:

var child = window.open();
child.location = '{SiteUrl}/TaskBoardContent/LanesDashboard.html?SiteUrl={SiteUrl}&ListUrl={ListUrlDir}&isDlg=true';
child.focus();

UNfortunately a new tab opens, but IE9 starts with a download of the given file. I expect the problem on the serverside headers send by SP. Any Ideas on that?


Solution

  • you should be able to configure this on webapplication scope. I don't think that there is any way to overwrite this behavior only for single file/site. Alternatively you can try adding simple aspx page without any code behind into your module.

    Check out this link:

    http://www.sharepoint-insight.com/2012/03/25/solution-for-viewing-html-files-in-browser-from-sharepoint-document-library/