External HTML served via Sharepoint 2010 - sharepoint-2010

In sharepoint 2003 (and 2007 I believe) when I put an HTML file in a shared folder I could visit it's URL and view it as a website.
With Sharepoint 2010 the 'attachment' content-disposition header is sent and I can no longer do this (the HTML file is downloaded rather than viewed).
I really want to make a micro site using data from a Sharepoint 2010 'list' (consumed via AJAX and the XML-RPC Sharepoint 2010 offers) but obviously this makes it difficult. Does anyone know how I could achieve this?
(PS. I need the full screen real estate for this microsite, so using HTML from within sharepoint would seem like a bad idea)

To get the HTML file to display instead of download you need to set the Browser File Handling setting in the General settings page for a web application in Central Administration. If this is set to 'Strict', then it will only open files with an OpenControl entry in the docicon.xml file. Try to set it to 'Permissive'.

I discovered that by giving an html file the .aspx extension, sharepoint will serve the document as html inlin, rather than as an attachment. Hope this helps someone else :)

Related

How do I insert html after outlook signature using Office-js

I am trying to insert html in to Outlook body. but if there any default signature exist I want to insert after the outlook signature.
Is there any way to get outlook signature? then i can append my html in to it and insert.
You may try to read the body before setting it Office.context.mailbox.item.body in the code. Office.js doesn't provide any specific property for that.
You can maybe try to use Outlook rest API. You could use now Outlook rest API in easy way from your add in. Read more about it in this link.
FYI The signatures are being kept as separate files in the Signatures folder. You can find this folder in the following location;
Windows XP
C:\Documents and Settings\%username%\Application Data\Microsoft\Signatures
Windows Vista, Windows 7, Windows 8 and Windows 10
C:\Users\%username%\AppData\Roaming\Microsoft\Signatures
To see this folder you must have “View hidden files and folders” enabled or you can simply copy and paste the above paths in the address bar in Explorer to directly open the folder.
Office.context.mailbox.item.body.getAsync API returns body with signature. Currently, we don't have API that returns signature only. We track Outlook add-in feature requests on our user-voice page. Please add your request there. Feature requests on user-voice are considered when we go through our planning process.

Download dynamic generated pdf from dynamic url which is being viewed in webbrowser control in adobe viewer in vb.net

I am developing a windows application in vb.net in which i have a url which first ask me to login on the website and then display a view pdf link. As i make it click it again redirect to another page where instead of asking for download pdf it opens it in my web browser control. Now i want to save that opened pdf on my specified path. I have googled a lot but didn't find any solution for the same. I even found some related posts but none of them have my answer. Here my pdf url doesnt contains any file name like '.pdf'. Url contains some token values. To open this url it requires login on the website. I am trying to download pdf file for many days. Please help me.
you have to push your file using http headers
Unique HTTP Headers Returned
because these headers are the only thing controlling how your browser handles the file.
Save As Mode (askapache_pdf=s)
Content-Disposition: attachment
Content-Type: application/pdf
for more info goto http://www.askapache.com/htaccess/pdf-cookies-headers-rewrites.html#Unique_HTTP_Headers_Returned
This does not have anything to do with server side scripting language its same that you have to add a response in your header of http request. But anyway in ASP you should try something like below
Response.AddHeader("content-disposition", "attachment;filename=somefile.ext")

Who knows which files should be included in a website?

When the browser requests a website, any website from a HTTP server, which of the two parses the site's content in order to know which other files need to be included on the webpage?
What I mean is this:
the browser asks for the html file and then observers that it needs to import some external css files and HE is the one who requests them.
OR
the HTTP server when faced with a request for a website, parses (already knows) which sites need to be linked to a certain webpage and sends them alongside the html page?
I'm guessing the first case is the correct one, but if someone can confirm and maybe clarify it, I'd appreciate it.
It's all done by the client (which is usually a browser). When it sees <script>, <iframe>, <img>, <link>, etc. tags that reference other documents, it downloads them if necessary.
According to Wikipedia -
The primary function of a web server is to cater web page to the
request of clients using the Hypertext Transfer Protocol (HTTP). This
means delivery of HTML documents and any additional content that may
be included by a document, such as images, style sheets and scripts.
and
The primary purpose of a web browser is to bring information resources
to the user ("retrieval" or "fetching"), allowing them to view the
information ("display", "rendering"), and then access other
information ("navigation", "following links").
It is the Browser that parses the HTML and request for the associated contents.

Sharepoint Web template

I have created a web template solution by following Vesa "vesku" Juvonen 's blog(http://blogs.msdn.com/b/vesku/archive/2010/10/14/sharepoint-2010-and-web-templates.aspx).
I have the web template and have created sub sites with it. Now I need to create a web template from this template, which would consist of lists and other items.
The publishing feature does not have the save as template option, So I get into the _layouts/savetmpl.aspx to create one or deactivate the publishing feature to create getthe "save as site template option and create one. It creates but does not work properly.
I access the site by appending the default.aspx to the newly created sites url and it does not have any features as that of root template. Is there any way to create a template from the existing web template to work correctly. I am a newbie to sharepoint and vesku's blog has been my reference.
Any options or views to do it correctly would be helpful.
I have thought about creating a site through code and given the user an option to do so by including a web part where he could click on say "create a webs site with XXX template and include XXX lists, web parts etc. Is it a good approach?
If the web site that you created a template for contains web parts that access the GAC (i.e. have DLL's), then you must take the wsp that is in the solution gallery and deploy it as a farm solution.
Templates saved via /_layouts/savetmpl.aspx cannot access the GAC.
if you made a webtemplate why would you want to use the save as site template option? Users can also create sites from your webtemplate and if you need a different template you just add another webtemplate.
The whole principal of web templates is meant to be used for site creation....

How can I download content from a webpage that requires login information

I am trying to create a small application that will download the content of a certain webpage. I am able to do that with certain web pages using WebRequest. However the web page I need to download from requires login information.
I am using C# and Visual Studio Express 2010
Thank you in advance...
Have a look at HttpWebRequest.Credentials.
You can either simply use HttpWebRequest.Credentials as CesarGon mentioned or if it's HTTP Basic authorization, add an appropriate HTTP header (that would be environment independent):
Authorization: Basic dXNlcm5hbWU6cGFzc3dvcmQ=
where dXNlcm5hbWU6cGFzc3dvcmQ= is base 64 encoded username:password.