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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T14:41:44+00:00 2026-05-13T14:41:44+00:00

I need to provide a way for the user to specify a path to

  • 0

I need to provide a way for the user to specify a path to a file on his machine on my intranet web application, and the ASP:FileUpload control provides a nice dialog to do that, however it also transfers the contents of the file over. Since I only need the file path and not the contents, is there another way to achieve this?

  • 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-13T14:41:45+00:00Added an answer on May 13, 2026 at 2:41 pm

    UPDATE : The code below will return the full file path in IE, but for security reasons, firefox and chrome only give you the file name. This might be a bit of a problem 🙂


    I took the liberty of implementing the solution given by RaYell. Here’s the code:

    Default.aspx (markup):

    <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="SO._Default" %>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head runat="server">
        <title></title>
        <script type="text/javascript">
            function submitFormWithoutFile() {
                var fileUpload = document.getElementById('<%= this.FileUpload1.ClientID %>');
                var filePath = document.getElementById('<%= this.FilePath.ClientID %>');
                filePath.value = fileUpload.value;
                fileUpload.parentNode.removeChild(fileUpload);
            }
        </script>
    </head>
    <body>
    
        <form id="form1" runat="server">
            <asp:HiddenField ID="FilePath" runat="server" />
            <asp:FileUpload ID="FileUpload1" runat="server" />
    
            <asp:Button ID="Button1" runat="server" Text="Do it!" OnClientClick="submitFormWithoutFile();" />
        </form>
    </body>
    </html>
    

    Default.aspx.cs (code-behind)

    namespace SO
    {
        using System;
        using System.Web.UI;
        using System.Web.UI.WebControls;
    
        public partial class _Default : System.Web.UI.Page
        {
            protected void Page_Load(object sender, EventArgs e)
            {
                if (Page.IsPostBack)
                {
                    // we have our file name but not the file
                    this.form1.Controls.Add(new Literal() { Text = this.FilePath.Value });
                    System.Diagnostics.Debug.Assert(this.FileUpload1.PostedFile == null);
                }
            }
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there any way to provide user log-in without the need for a DB.
I need to provide our web developers an easy and quick way to test
I have an application that creates an audio file. I need to provide a
I have written an ASP.NET MVC application that allows the user to specify their
So I'm working on a web app where a user will need to: provide
I will need to provide a way for a user (who will be using
To create facebook android native app we need to provide our Android application signature
I have a wcf web service and I need to provide the client with
Please lead me in the right direction. I need to provide user with small
My application reads a csv file provided by the user. This csv file contains

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.