Solved

Open Folder Location or File on a button click

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

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
jquery + C#.net radiobuttonlist 3 45
Generate Unique ID in VB.NET 21 104
asp.net mvc , views, hidden values ? 2 23
ASP.NET data base connection 35 40
Sometimes in DotNetNuke module development you want to swap controls within the same module definition.  In doing this DNN (somewhat annoyingly) swaps the Skin and Container definitions to the default admin selections.  To get around this you need t…
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…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

733 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