# Uploadng images(needy)

**URL:** <https://www.ruby-forum.com/t/uploadng-images-needy/135268>\
**Category:** Rails\
**Created:** [April 20, 2008, 12:08pm UTC](https://www.ruby-forum.com/t/uploadng-images-needy/135268 "2008-04-20T12:08:24Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![anasmd](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e495f1/32.png) [@anasmd](https://www.ruby-forum.com/u/anasmd)\
**Post date:** [April 20, 2008, 12:08pm UTC](https://www.ruby-forum.com/t/uploadng-images-needy/135268/1 "2008-04-20T12:08:24Z")

</div>

thanq for suggestions…  
but im using fileutils and im giving user to upload only one  
image…  
so for that im using filutils

in app…i wrote the code as

#File.open("/public/images/#{self.id}",“wb”)

# { |f| f.write(params(register[‘photo-url’]).read) }

this code is writing the file to public folder but  
it’s content is not reading…  
it’s showing 0bytes in that image…  
plzzzz help me very very urgent  
md anas

---

<div class="post-metadata">

**Author:** ![anasmd](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e495f1/32.png) [@anasmd](https://www.ruby-forum.com/u/anasmd)\
**Post date:** [April 20, 2008, 12:24pm UTC](https://www.ruby-forum.com/t/uploadng-images-needy/135268/2 "2008-04-20T12:24:43Z")

</div>

On 20 Apr 2008, at 11:08, Anas Ali wrote:

> 

Well I don’t know what your the name of your form parameters are, but  
that looks very wrong. It’s more likely to be something like params[…]

Fred

---

<div class="post-metadata">

**Author:** ![anasmd](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/e495f1/32.png) [@anasmd](https://www.ruby-forum.com/u/anasmd)\
**Post date:** [April 20, 2008, 2:14pm UTC](https://www.ruby-forum.com/t/uploadng-images-needy/135268/3 "2008-04-20T14:14:53Z")

</div>

Anas Ali wrote:

> thanq for suggestions…  
> but im using fileutils and im giving user to upload only one  
> image…  
> so for that im using filutils
> 
> in app…i wrote the code as
> 
> #File.open("/public/images/#{self.id}",“wb”)
> 
> # { |f| f.write(register[‘photo-url’]).read) }

“register[‘photo-url’]” is the parameter taken from the form(i.e.  
view)  
this code is writing the file to public folder but

> it’s content is not reading…  
> it’s showing 0bytes in that image…  
> plzzzz help me very very urgent  
> md anas
