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

  • Home
  • SEARCH
  • 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 7673609
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T16:33:07+00:00 2026-05-31T16:33:07+00:00

My web application needs to be able to accept the FILE NAME/PATH to a

  • 0

My web application needs to be able to accept the FILE NAME/PATH to a file – the file will be on a network resource which is available to both the client machine – and to the web server.

In a prior thread, Rajkumar Reddy, suggested this strategy:

Add windows openfile dialog reference toweb application by righ click on solution explore >project name add reference system.windows.forms then follow this coding style here i have >given vb sample code you can convert this to c# if your facing any problem tell me.


Import system.threading

Protected Sub btnUpload_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnUpload.Click

    Dim objThread As New Thread(AddressOf FnOpenFileDialog)
    objThread.IsBackground = True
    objThread.SetApartmentState(ApartmentState.STA)
    objThread.Start()
End Sub

Private Sub FnOpenFileDialog()
    Dim openfile As New System.Windows.Forms.OpenFileDialog
    'openfile.InitializeLifetimeService()
    'openfile.Filter = String.Format("Image file (*.jpg)|*.jpg|All files (*.*)|*.*")
    openfile.Filter = String.Format("Image file (*.jpg)|*.jpg")
    openfile.Multiselect = True
    openfile.ShowDialog()
End Sub

I added these two subs to a aspx page – and I can get the openfiledialog to open. I can get the file name/path into a shared variable. However, I cannot get the page to automatically update with the returned information.

I have more code I can post – but, I’m not really sure which part isn’t working.

  • 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-31T16:33:09+00:00Added an answer on May 31, 2026 at 4:33 pm

    That won’t work at all.

    Showing the file dialog in a web application only works when the web server and the web client is the same computer, i.e. only when you are testing the web application locally on your own computer.

    When you deploy the web application on the server, the dialog would open on the web server, not the computer surfing to the server, but the web server doesn’t have a user interface where it can show the dialog.

    Also, it doesn’t work even when you run the web application locally. As you are starting a new thread for the dialog, the web server contines to complete the page and send it to the browser. When you have selected a file, the Page object isn’t there any more. The response has already been sent to the browser, so it’s too late to change it.

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

Sidebar

Related Questions

I have a growing web application which now needs to be able to store
So, I'm writing a Cocoa application that needs to be able to display web
I have a web application that needs to take a file upload from the
I have a C# web application that needs to deploy a file to the
I'm writing a web application in PHP which needs to store images and image
For my web application running on LAMP, I need to be able to deploy
I have a web application that needs to fire off a long-running SQL Server
I develop a web application that needs to be load balanced across 4 webservers.
I am building a web application that needs to print directly from browser, however,
I'm building a web application that needs to send notifications by SMS. What SMS

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.