Solved

Best Practice: Viewing documents stored on a server in a web application

Posted on 2013-11-18
6
333 Views
Last Modified: 2013-12-10
Hello All,

I currently have Excel/Word/Text files saved on a remote server that I would like to run my web application on.  What are best practices for viewing the files as a user of the web application?  If possible, I would like to do so without saving the files locally.  If anybody could provide help it would be greatly appreciated.
0
Comment
Question by:uconnfb13
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
6 Comments
 
LVL 23

Accepted Solution

by:
Jens Fiederer earned 500 total points
ID: 39657543
Generally this can be handled by simply sending the file in the response, something like:

            Response.Clear();
            Response.ContentType = "application/octet-stream";
            Response.AddHeader("content-disposition", "attachment; filename=" + Path.GetFileName(path));
            Response.TransmitFile(extract.FilePath);
            Response.End();

Open in new window

0
 
LVL 23

Expert Comment

by:Jens Fiederer
ID: 39657548
Note that for this to work for Excel or Word, the clients will need to have Excel or Word (or some other app able to read them) installed locally.
0
 

Author Comment

by:uconnfb13
ID: 39673367
Thank you for the replies.  Is there something more that I need to do other than pasting in that C# snippet with the appropriate file path?  When I do so nothing happens.  No error, but nothing happens at all.

Thanks.
0
Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

 
LVL 23

Expert Comment

by:Jens Fiederer
ID: 39673444
Where are you pasting it?

The snippet was copied from actual working code, but context might matter.
0
 

Author Closing Comment

by:uconnfb13
ID: 39709472
Your solution worked.  The issue ended up being with the Update Panel on the page.  Thank you.
0
 
LVL 23

Expert Comment

by:Jens Fiederer
ID: 39709551
My pleasure
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

615 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question