# Download file, allow cookies

**URL:** <https://www.ruby-forum.com/t/download-file-allow-cookies/173085>\
**Category:** Ruby\
**Created:** [August 2, 2009, 2:11am UTC](https://www.ruby-forum.com/t/download-file-allow-cookies/173085 "2009-08-02T02:11:03Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![fedekun](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/97f17d/32.png) [@fedekun](https://www.ruby-forum.com/u/fedekun)\
**Post date:** [August 2, 2009, 2:11am UTC](https://www.ruby-forum.com/t/download-file-allow-cookies/173085/1 "2009-08-02T02:11:03Z")

</div>

Hi, well, when i download an image from a site, instead of download  
the required image it downloads an image which says “Allow Cookies”.  
How can i download that image?  
This is what i was using

writeOut = open(first\_page.to\_s + “.”+extension, “wb”)  
writeOut.write(open(img\_to\_download).read)  
writeOut.close
