view XLSX file in browser C# - c#

I want to view the XLSX file in browser just like we read the PDF file there.
What plugin or code should i use to achieve it?
I am running the web site in intranet and all the users has the office installed in their PC. And they want to view the file in browser instead of downloading and then view it. The browser i am targeting are IE and chrome.
Let me know comments. Thank you.

Related

File Drag&Drop from Browser to Browser

My asp.net web application is some kind of "document managment system" saving files in the file system of the server.
The stored files are shown in an asp:ListView control and are downloadable as HTTP- Download. But I also want to drag&drop them into another browser window to upload the draged file to an cloud storeage like dropbox or google drive oslt.
I did some research and I didn't find any solution for this problem. I don't know if this is even possible. Maybe someone has an idea how this could be done?
I am pretty sure you can't have a web application doing that for you because it involves having your web language interacting with your computer, to move a local file to another window or tab in the browser.
It would be similar to have Javascript accessing your local files without the user "help". That is not allowed.
Rather than doing that, why not connect to Google Drive or Dropbox API and make the upload yourself?
In the piece of code where you trigger the download, you could also trigger an upload to the desired service.
Here are the API Documentation for the mentioned services:
https://www.dropbox.com/developers/documentation/http/documentation#file_requests-create
https://developers.google.com/drive/api/v3/manage-uploads

How to Display a word or anyother Document into asp.net page without downloading from sharepoint

my project is a finance based website,
now when ever we upload a word,PDF or Excel document the file is Directly saved in sharepoint and a link is provided to user or the the person whom he submits the invoice or application but according to the new requirement we should provide a view button that basically display the content to the file Kinda like opening a word file on Gmail or yahoo..!!,
as far as i know to open them the file must be physically be on the server to be opened by viewer but the file is uploaded in Sharepoint directly as mentioned earlier
and i can't write any code for the file to be downloaded on server or on client machine coz
reason 1: File may be to Large
reason 2: Performance will be reduced
so is there any other way i can open that respective file in a viewer or popup without downloading it on server or on client machine
Please help me on this
Thanks
If I understood your question correctly , you want view the file in browser ?
Use Office Web Apps with SharePoint
Install office webapp
Activate it

c# Open and write to external browser from windows form

I have a C# Windows form application and I need to open a a webpage that sends SAML off to a server with then does auth and redirects to the destination. Since the SAML I am writing/sending changes every time, I've been writing a simple file to the temp folder and opening it via the default browser. Internet Explorer doesn't like doing this and balks saying the content is blocked.
Is there any way I can, from a Windows form, open an external browser and write content to it?
I added
<!-- saved from url=(0016)http://localhost -->
in the html file I'm opening from the local temp folder and now IE opens it just fine.
Answer found from
Why does IE restrict the JavaScript files of local HTML pages?

Local Machine Saving Report / How to path of local machine using ASP.NET C#

I have a problem, I have a web application (ASP.NET) it is installed in the server computer, if I run it on my computer (locally) of course it works properly, the reports are generated in my machine.
But when I installed it in the server and access the application from the server, and tried to generate report (using a button) it was not on my machine but it saves to the server machine.
I'm currently using this path as my file saving location:
This is where my Reports(.pdf) saves/generated
string folderDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments);
What should I do to save my report in my local machine if the web application is installed only in the server?
Btw. im using "iTextSharp" as my PDF Exporter/Generator and System.IO for file handling.
Thanks in advance have a nice day!
you have to download this PDF file.
1. use a link
2. or your server code will return you a file result directly.
It should be obvious that you shouldn't save the document as a file on the server, because the more users create a PDF, the more disk space you'll need (or you'll need to clean up the files after they have been server).
It is much better to create the PDF in a memory stream and then serve that stream to the browser.
See How to return PDF to browser in MVC? for an example.
If you want the user to see a "Save as" dialog box, you need to define an extra HTTP header:
Response.AppendHeader("content-disposition", "attachment; filename=yourfile.pdf");
Note the value attachment. By default, this value is inline in which case the PDF is shown in the browser. By changing this to attachment, the browser will open a "Save as" dialog box.

Use google doc API in asp.net C# web application

I am developing a web application in C#.net. I need to edit a file placed on the server in browser it self(Without downloading it on local machine) and when I save that file, the changes should be reflected in file. For this I want to use google API but I don't know how can I use this.
I want to do like below.
When I click on file name, it should open in browser.
When clicked on edit, it open in edit mode in browser using google doc.
When I save that file, the changes should be reflected in my file which is placed on company server.
How can I do all this thing with google doc API?
Install Google Drive on your server.
Edit the file in Google docs, let Google Drive sync it to the local hard drive.
It is not possible for HTTP protocol, because the basics system doesn;t support it. You can open the file but the file will be downloaded to your local machine in then it will open, you have to specify the MIME type in IIS.
You can use two ways to do a similar job done.
1 By Using FTP
2 Customized solution : Make a page put a text field and load the file (.cs) in it and with submit save it to the file back.
You can embed a google doc in Webpages. But the file would be accessed and saved on Google's servers and not your company server:
Wordpress allows you to do it. Potentially you can see if it possible to do it in a similar way:
http://en.support.wordpress.com/google-docs/
I am not sure if Google has an option of accessing docs from servers outside google's domain.

Categories