Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6991139
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T19:27:19+00:00 2026-05-27T19:27:19+00:00

I am working in a file management system.I have uploaded a document into a

  • 0

I am working in a file management system.I have uploaded a document into a directory which is in server and i’ve listed all the uploaded files in a gridview with documentname as linkbutton.

My problem is that i’ve to open that particular file on clicking documentname which is actually a link button. Here’s my code for that.

protected void gdlbtnDocName_Click(object sender, EventArgs e)
{
    try
    {
        LinkButton lkbtn = (LinkButton)sender;
        if (File.Exists(lkbtn.CommandArgument))
        {
            System.Diagnostics.Process.Start(lkbtn.CommandArgument);
        }
    }
    catch (Exception ex)
    {
        lblMessage.Text = ex.Message.ToString();
    }
}

lkbtn.CommandArgument is the filepath say(G:\dms\eg.text).
This code works fine in development centre.But when i published it and run on the localhost, its not working .

Can any one help me please ….

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T19:27:19+00:00Added an answer on May 27, 2026 at 7:27 pm

    The problem you’re facing is that the Process.Start will run on your server so the document will be opened not on your localhost, but on the server.

    If you want to open a document that is stored on the server, you will first have to download it to the local machine.
    If that’s not an option, you can create a preview of the document that the user can view in his browser.

    How to create the preview depends on the file type you want to display.

    For a simple text file, you can just read the file on the server and render the string (make sure to do some Html Encoding!)

    In a project I worked on we also had to display PDF and Word files. We ended up using a commercial product from Aspose. When a user uploads a file to the server we immediatelyprocess the file trough Aspose and then cache the result on the file system.


    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working on a file management application which parses excel files from the
I am working on project -online file management where we have to tore file
i am working on a online file management project.In which we are storing references
While setting up an online file management system, and now I have hit a
I'm working on a file management system and would like to include an automated
im working on a content management system for that i have to download a
As I am working on Employee Management system, I have two table (for example)
We have an Ant and Ivy-based build management system, which basically consists of a
I have been working on a content management system (nakid) and one of my
I'm working on a PHP content management system and, in testing, have noticed that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.