# File\_column - blank folder created, no upload

**URL:** <https://www.ruby-forum.com/t/file-column-blank-folder-created-no-upload/62183>\
**Category:** Rails\
**Created:** [June 1, 2006, 10:02am UTC](https://www.ruby-forum.com/t/file-column-blank-folder-created-no-upload/62183 "2006-06-01T10:02:31Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Remy\_Lopez](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/51bf81/32.png) [@Remy\_Lopez](https://www.ruby-forum.com/u/Remy_Lopez)\
**Post date:** [June 1, 2006, 10:02am UTC](https://www.ruby-forum.com/t/file-column-blank-folder-created-no-upload/62183/1 "2006-06-01T10:02:31Z")

</div>

i want to upload and resize images so i installed the file\_column plugin  
but im having a big trouble, i have a table images with (id, name)  
fields where the images names/path will be stored, i get a success  
message(from the controller after @art\_image.save) every time i try to  
upload but only a blank directory its created /public/image/name/tmp ,  
without errors messages, i see a post related to the same problem but i  
coulndt find anything there that help to fix this.

By the way, im using rails1.1/ruby1.8.2(or RMagick wont work on  
windows), windows and webrick, here is my code

#view-------index.rhtml

# Upload

\<%= form\_tag({:action=\>‘create\_art\_image’, :id=\> @art\_image}, :multipart  
=\> true)%\>  
  
  
\<%= file\_column\_field “image”, “name” %\>  
\<%= submit\_tag ‘Upload’ -%\>  
\<%= end\_form\_tag %\>

#controller-------create\_art\_image action  
def create\_art\_image  
@art\_image = Image.new(@params[:art\_image])  
if @art\_image.save  
flash[:notice] = ‘Sucess.’  
redirect\_to :action =\> ‘index’  
else  
flash[:notice] = ‘Error.’  
render :action =\> ‘index’  
end  
end

#model--------image.rb  
class Image \< ActiveRecord::Base  
file\_column :name  
end

---

<div class="post-metadata">

**Author:** ![Remy\_Lopez](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/51bf81/32.png) [@Remy\_Lopez](https://www.ruby-forum.com/u/Remy_Lopez)\
**Post date:** [June 2, 2006, 3:45am UTC](https://www.ruby-forum.com/t/file-column-blank-folder-created-no-upload/62183/2 "2006-06-02T03:45:38Z")

</div>

It looks like you are on the right track with file\_column. It would be a  
shame to roll your own. Did you see a row in your database for the  
image? If  
not, look at your logs and see whether there’s a good reason why.

–  
View this message in context:  
[http://www.nabble.com/file\_column----blank-folder-created%2C-no-upload-t1715324.html#a4672823](http://www.nabble.com/file_column----blank-folder-created%2C-no-upload-t1715324.html#a4672823)  
Sent from the RubyOnRails Users forum at [Nabble.com](http://Nabble.com).

---

<div class="post-metadata">

**Author:** ![Remy\_Lopez](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/51bf81/32.png) [@Remy\_Lopez](https://www.ruby-forum.com/u/Remy_Lopez)\
**Post date:** [June 2, 2006, 8:10pm UTC](https://www.ruby-forum.com/t/file-column-blank-folder-created-no-upload/62183/3 "2006-06-02T20:10:05Z")

</div>

Steve R. wrote:

> It looks like you are on the right track with file\_column. It would be a  
> shame to roll your own

why would it be a shame? the file upload functionality i needed amounted  
to about 5 lines of code. what would be a shame would be having to  
additionally grab that plugin for each deployment when it wasnt  
necessary…plus its often quicker to write something that learn someone  
else’s thing (this is especially true in 5 vs 27669 line scenarios)

plus youll learn something.

there are some things i wouldnt want to invent. like rails itself… 🙂

---

<div class="post-metadata">

**Author:** ![Remy\_Lopez](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/51bf81/32.png) [@Remy\_Lopez](https://www.ruby-forum.com/u/Remy_Lopez)\
**Post date:** [June 2, 2006, 8:22pm UTC](https://www.ruby-forum.com/t/file-column-blank-folder-created-no-upload/62183/4 "2006-06-02T20:22:45Z")

</div>

It seems like a shame because file upload, and particularly image upload  
is  
so often performed. Add to that the handling of failed uploads and  
creating  
multiple sizes at upload time and you have significant functionality  
that I  
personally can’t write in 5 lines of code and would prefer not to write  
for  
each app.

I know there’s a debate whether this belongs in the view or the model,  
but  
that’s OT for this thread.

## That’s all I was getting at.

View this message in context:  
[http://www.nabble.com/file\_column----blank-folder-created%2C-no-upload-t1715324.html#a4684476](http://www.nabble.com/file_column----blank-folder-created%2C-no-upload-t1715324.html#a4684476)  
Sent from the RubyOnRails Users forum at [Nabble.com](http://Nabble.com).
