# Problem in file\_column

**URL:** <https://www.ruby-forum.com/t/problem-in-file-column/77900>\
**Category:** Engines\
**Created:** [December 1, 2006, 12:02pm UTC](https://www.ruby-forum.com/t/problem-in-file-column/77900 "2006-12-01T12:02:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Chintan\_Shah](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/59ef9b/32.png) [@Chintan\_Shah](https://www.ruby-forum.com/u/Chintan_Shah)\
**Post date:** [December 1, 2006, 12:02pm UTC](https://www.ruby-forum.com/t/problem-in-file-column/77900/1 "2006-12-01T12:02:14Z")

</div>

Hi all,

Can any body tell me how to get the name of the file in cntroller,  
which i m going to upload? coz i want to play with the file extension. I  
have to put the restriction like only following types of files can be  
uploaded  
.jpg, .png, .bmp, .gif

---

<div class="post-metadata">

**Author:** ![Chintan\_Shah](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/59ef9b/32.png) [@Chintan\_Shah](https://www.ruby-forum.com/u/Chintan_Shah)\
**Post date:** [December 1, 2006, 12:05pm UTC](https://www.ruby-forum.com/t/problem-in-file-column/77900/2 "2006-12-01T12:05:31Z")

</div>

Chintan Shah wrote:

> Hi all,
> 
> Can any body tell me how to get the name of the file in cntroller,  
> which i m going to upload? coz i want to play with the file extension. I  
> have to put the restriction like only following types of files can be  
> uploaded  
> .jpg, .png, .bmp, .gif

by using params[:friend][:photo1].original\_filename
