I am saving an html document in the windows azure blob. Now i am trying to open that document by putting its URI in the address bar. But browser redirect me to orbit downloader to download that document. How can i open it by its blob uri? My document blob uri :
https://xxxxxx.blob.core.windows.net/user/name.html
You need to change the content type of that file to html. This is possible using tools like Azure Storage Explorer (see point 3D) or by using the SDK/REST API.
Related
Does anybody know how to specify a download location for specific file types when downloading them through the WebView2 control?
Example:
PDF files go to D:\PDF, and Excel files go to D:\Excel
As far as I know you can only specify a download location when using a WebClient programatically, which can only download from a specific url eg.
WebClient WB = new WebClient();
WB.DownloadFile("http://example.com/example.txt", #"d:\example.txt");
WebView is meant to be a WebBrowser control based on chromium, it will act like a web browser unless you directly modify it (source code).
So to answer your question, there is not a way to specify a download location for a specific file type using the WebView2 control.
You can however build yourself a downloader, which downloads files to a specific location from a url using the WebClient in C#.
I'm trying to open a document on server through google docs.
I can get the path and name of the file on the server.
And then on Button click event I wrote a method to open the file through google document reader.
string path = \\xxx-yyyyy-zzz\DocShare\sample1.doc //path of the file on server
Response.Redirect("http://docs.google.com/viewer?url=" + path);
When I run this code, I'm getting something like below
Can some one help me to find where did I go wrong? Is there any other method to open any document(ppt, doc, pdf etc) using google document reader.
TIA
What is \\xxx-yyyyy-zzz\DocShare\sample1.doc and where it is ?
A relative url dosen't specify a protocol & domain which makes the
browser to assume the document is referd from the same site/domain.
Please verify if you can access the document itself with the relative path.
http://docs.google.com/viewer?url=https://s3.amazonaws.com/scotchio/First-Node-App.pdf works for me as i can access the pdf. Try using the absolute url of the document
It doesn't work most likely because the file is not accessible from the Internet. The google doc previewer needs to be able to access the file in order to display it.
Requirement:
I have a pdf file in my machine. Using console\windows application, i need to open that pdf file from browser itself. I am getting answers to open pdf file in browser using ASP.NET. But i need answer to open pdf in browser using console app.
I tried the below code:
string localURL = #"C:\MyLocation\apllication demo.pdf";
System.Windows.Controls.WebBrowser webbrowser = new System.Windows.Controls.WebBrowser();
webbrowser.Navigate(localURL);
But no use. It asusual opening in its default application.
This is simply because you are supplying a wrong path.
For browser, the path would look like this:
string localURL = "file:///C:/MyLocation/apllication%20demo.pdf"
Note that %20 is a space character,so perhaps use string.Replace(" ","%20") when building the Url.
I'm using LiveSDK in C#. Is there any way to get an URL (for example, url like this: https://onedrive.live.com/embed?cid=1ED5694B634A1579&resid=1ED5694B634A1579%21685&authkey=ANQwPScWiCxbILY) for a specified image file in order to put this link directly to the Image (Source property) control?
I dont want to download a Stream from OneDrive file, set it to a BitmapImage and put it to the Image control.
I know that OneDrive web app allows to create an URL for a selected file, but don't know if the SDK has such feature.
There is a very good example in MSDN Samples Page showing how to pull and use images from OneDrive.
Photo Sky SampleThis sample demonstrates how to use the LiveSDK for pulling images from SkyDrive. In this sample you will learn how to use LiveSDK and request consent from the user to access his SkyDrive files and display the images in a Metro style application.
Source: PhotoSky - SkyDrive Sample
I have a requirement where i want to load pdf document in a web page from a physical path. The pdf document location is not inside my website directory. To elaborate on this with example: Let assume my virtual directory refers to "c:\website". I have all my pdf documents stored under different folder called c:\pdfDocuments". On one of my web page i want to load my pdf document from c:\pdfdocuments. Is there way to pass the absolute path in this case (c:\pdfdocuments\x.pdf) to frame control's src attribute.
Thanks
CS
No, you cannot do that unless the C:\pdfdocuments is also a website; and in that case you would need to pass in the URL that relates to that physical path.
Keep in mind that the frame, or other html element, is trying to load the contents of the file accross the internet from the browser to your server. The browser on the clients end has no knowledge nor access to your physical filesystem, only what is exposed via the web server.
Now, if you're trying to load this on the server side, then you should be able to use the physical path as long as the worker process has access permissions to that path. But based on the question ".. to frame control's src attribute." I'm assuming you're referring the the client side html.