RSS Forums RSS
Please support our ASP.NET advertiser: Lunarpages ASP Web Hosting

Open file Dialog in asp.net

Join Date: Apr 2007
Location: Birmingham
Posts: 393
Reputation: Fungus1487 is on a distinguished road 
Rep Power: 2
Solved Threads: 39
Fungus1487's Avatar
Fungus1487 Fungus1487 is offline Offline
Posting Whiz

Re: Open file Dialog in asp.net

  #4  
Nov 15th, 2007
ok then just simply add an onchange event to your FILE input.
<form name="form1"/>
    <input type="file" name="filediag" style="display:none"
            onchange="window.open(this.value, '_blank')" />
    <input type="button" value="browse..." 
            onclick="document.form1.filediag.click()" />
</form>
the above code will open the path of the file in a new browser window.

be aware this is only supported by I.E.6 + mozilla 1.5+ i believe as the onchange event in an INPUT of type file never used to work.
When Autumn Falls [ http://www.whenautumnfalls.co.uk ] &&
Designdotworks [ http://www.designdotworks.co.uk ] Web / Graphic / Software Design
Reply With Quote  
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 4:08 am.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC