Asp – Flexible File-Open Dialogue Required thats not

asp.net-mvc

I require to allow the user to select a file from the network drive from the webpage and have the chosen file path display into a textbox. I must also be able to set a default directory for the dialogue to open into each time.

The problem I have with the traditional approach is that I cannot paste a link in there (incase the user wants to enter a web address rather than a file path). Also, I cannot set a default easily.

Does anyone know a more flexible approach since here i'm not uploading any files, just want to return the full path to a file the user selects with a open dialogue invoked by mouse click on a button or image

Many thanks in Advance

John

Best Answer

You could use a technique similar to what others have used to make the default element look pretty. Using CSS, you can hide the underlying HTML input control and place separate textbox and button controls on top of it. That way you can control the appearance of the browse box while still having control of the input on the textbox.

Here's a good article you can use to learn how to style the control and how to construct the javascript necessary to make it work.

Related Topic