?
Solved

Open Folder Location or File on a button click

Posted on 2010-11-17
2
Medium Priority
?
634 Views
Last Modified: 2012-05-10
Hello Experts,

I have a webform that's hosted on our webserver.  The web form allows the user to save out files to a folder that lives in the directory where the application is hosted.  This is all working.

What I need is:
A button with the ability to open Windows explorer to the location of the folder.
A button with the ability to open a particular file in that folder.  (It's a word file)

I'd really need server-side code for this, and would prefer to use a button over a hyperlink.

Thanks!
Moe
0
Comment
Question by:mauricerichard
2 Comments
 
LVL 7

Accepted Solution

by:
JosephEricDavis earned 2000 total points
ID: 34159032
Windows explorer will not be able to have access to a file that lives on your web server.  However, you can set up your web server so that a specific directory can be configured with directory browsing.  Then when the user clicks on this button of yours that is supposed to open up the folder you can just forward them to the url of your directory on your webserver, or open up that url in a new window.

To have the other button open up a word file that exists on the server you could have the button click event in the server side code override your http response so that instead of sending an html document in response to the request it will send down the word document.  The user would then be prompted if they want to save or open the file as you often do when you download a file from the internet.

Here are a couple of examples on how to do this...

http://www.west-wind.com/weblog/posts/76293.aspx

http://dotnetslackers.com/Community/blogs/haissam/archive/2007/04/03/Downloading-Files-C_2300_.aspx
0
 
LVL 1

Author Closing Comment

by:mauricerichard
ID: 34187500
Thanks for the info!
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

This article discusses the ASP.NET AJAX ModalPopupExtender control. In this article we will show how to use the ModalPopupExtender control, how to display/show/call the ASP.NET AJAX ModalPopupExtender control from javascript, how to show/display/cal…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Suggested Courses

809 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