Solved

Open Folder Location or File on a button click

Posted on 2010-11-17
2
593 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 500 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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Lots of people ask this question on how to extend the “MembershipProvider” to make use of custom authentication like using existing database or make use of some other way of authentication. Many blogs show you how to extend the membership provider c…
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

816 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now