Solved

Open Folder Location or File on a button click

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

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…
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

706 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

18 Experts available now in Live!

Get 1:1 Help Now