# Want to upload file using Browse button

**URL:** <https://www.ruby-forum.com/t/want-to-upload-file-using-browse-button/162748>\
**Category:** Ruby\
**Created:** [March 13, 2009, 11:23am UTC](https://www.ruby-forum.com/t/want-to-upload-file-using-browse-button/162748 "2009-03-13T11:23:34Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![bibhu\_behera](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/6de8d8/32.png) [@bibhu\_behera](https://www.ruby-forum.com/u/bibhu_behera)\
**Post date:** [March 13, 2009, 11:23am UTC](https://www.ruby-forum.com/t/want-to-upload-file-using-browse-button/162748/1 "2009-03-13T11:23:34Z")

</div>

Below is the code:

$ie.file\_field(:id,’\_20\_file’).click\_no\_wait

$ie.file(:id,’\_20\_file’).click

$ie.button(:id,’\_20\_file’).click

Not working above all script. Please any pointer ?

---

<div class="post-metadata">

**Author:** ![bibhu\_behera](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/6de8d8/32.png) [@bibhu\_behera](https://www.ruby-forum.com/u/bibhu_behera)\
**Post date:** [March 13, 2009, 2:12pm UTC](https://www.ruby-forum.com/t/want-to-upload-file-using-browse-button/162748/2 "2009-03-13T14:12:54Z")

</div>

I assume you’re talking about watir. I don’t think you need to click,  
but maybe focus. you can don’t need to click. You can do  
$ie.file\_field(:id,‘\_20\_file’).set(‘C:\<Path\_to\_file\>’)

thanks,

Bassel  
[http://www.imustrant.com](http://www.imustrant.com)

Bibhu Behera wrote:

> Below is the code:
> 
> $ie.file\_field(:id,‘\_20\_file’).click\_no\_wait
> 
> $ie.file(:id,‘\_20\_file’).click
> 
> $ie.button(:id,‘\_20\_file’).click
> 
> Not working above all script. Please any pointer ?
