views:

20

answers:

1

In my ASP.NET project, I want to add a facility to my page so that when the user clicks a button, a 'browse file' dialog box directly opens up. After he selects the file in the dialog box, I want to save that image on the server, and update an imagebox based on that selection.

Is there some sort of dynamic 'browse for file' type dialog box that I can use?

A: 

You can check this demo.

Article (http://vremenno.net/js/javascript-snippets-plus-new-file-input/) is in Russian, but you can always use Google Translate.

Source code available here: (http://vremenno.net/examples/updated-file-input-styling/UpdatedFileInputStyling.zip)

Sorry for ugly links: this is my first post and I'm not allowed to use more than one link.

graycrow
Thank you for your answer, but I ended up using the FileUpload control anyway. I made it so that when the user clicks the "change photo" button, the previously invisible FU control becomes visible and the button's caption changes to "OK! Update pic!".Based on the button's caption it either reveals the FU control, or saves the file present in the FU and hides it again.Working on a small project after which I will not touch web dev for a long while, so I'm not sure about investing time in learning javascript bits.Thanks anyway!
ricji