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 979791
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T04:16:26+00:00 2026-05-16T04:16:26+00:00

I have a web application which I uploaded using IIS. I want the users

  • 0

I have a web application which I uploaded using IIS. I want the users using the application would be able to select a file located on their (the user) computer and read its contents.

The code is:

TextReader trs = new StreamReader(faFile.Value);
            DataAccessLayer.clearFA();
            string line = trs.ReadLine();
            // Read all unneeded data 
            while (line != "** Start Data **")
            {
                line = trs.ReadLine();
            }
            line = trs.ReadLine();
            while (line != null)
            {
                string[] words = line.Split('*');
                // There is no message
                if (words[4] == "")
                {
                    DataAccessLayer.insertIntoFA(Int32.Parse(words[1]), words[3].Replace("'", ""));
                }
                else
                {
                    DataAccessLayer.insertIntoFA(Int32.Parse(words[1]), words[4].Replace("'", ""));
                }
                line = trs.ReadLine();
            }         
        }

When I run it from my pc it works. But when I try to run it from the IIS it gives me the following error:

Could not find a part of the path 'C:\Documents and Settings\myUser\Desktop\file.txt'. 

I understand that the application cant read the file from the user pc. Any idea how can I make it work?

Thanks!

Greg

  • 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-16T04:16:26+00:00Added an answer on May 16, 2026 at 4:16 am

    This is done for security reasons – a browser does not have access to the filesystem of the user.

    There is no way to work around this, as all other technologies running inside a browser are sandboxed and limited (again, for security reasons).

    The closest you can get is to use an <input type="file"> that lets the user to select a file for upload.

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

Sidebar

Related Questions

I have a web application which can receive files uploaded by users. These files
I have a web application which needs to perform a file copy operation and
Using JDeveloper as my IDE, I have a web application which calls services provided
I have a PHP based web application which is currently only using one webserver
I have an application which uploads file from iPhone to web server. Problem is
We have a web application which needs to store uploaded images with EdgeCast or
I want to accomplish the following task. I have an web application through which
I have a PHP web application running on IIS, which allows a user to
I want to create symlinks with a web application which is running in IIS
I have a web application which uses LDAP for log in. I'm using Openid4Java

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.