# Creating files

**URL:** <https://www.ruby-forum.com/t/creating-files/144187>\
**Category:** Ruby\
**Created:** [July 26, 2008, 11:29am UTC](https://www.ruby-forum.com/t/creating-files/144187 "2008-07-26T11:29:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![sijo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/da6949/32.png) [@sijo](https://www.ruby-forum.com/u/sijo)\
**Post date:** [July 26, 2008, 11:29am UTC](https://www.ruby-forum.com/t/creating-files/144187/1 "2008-07-26T11:29:11Z")

</div>

Hi  
i have  
\<%= file\_field\_tag “logo” %\> using that i upload image files.,.In  
controller how can i write this to a folder with a given fixed name…For  
example suppose uploaded file original name is abc.png,(or abc.jpeg )but  
in controller i have to name it to logo.png or logo.jpeg and write it to  
a folder /opt/upload/logo.png (or /opt/upload/logo.jpeg) That means  
if the file there already exists it shud overwrite also …How can i do  
this .Please help

Thanks in advance  
Sijo
