# Updating with Paperclip

**URL:** <https://www.ruby-forum.com/t/updating-with-paperclip/159602>\
**Category:** Rails\
**Created:** [February 6, 2009, 8:12am UTC](https://www.ruby-forum.com/t/updating-with-paperclip/159602 "2009-02-06T08:12:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![david](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/aeb1de/32.png) [@david](https://www.ruby-forum.com/u/david)\
**Post date:** [February 6, 2009, 8:12am UTC](https://www.ruby-forum.com/t/updating-with-paperclip/159602/1 "2009-02-06T08:12:04Z")

</div>

I cannot seem to get paperclip working for my file uploads after  
switching from attachment\_fu. I have the correct fields migrated into  
the database, have included has\_attached\_file :photo, :styles =\>  
{ :thumb =\> “175x175\>” } in my mode, but no photo is ever saved in the  
database and there are no errors. Looking in the console I noticed  
that it says paperclip is “Saving files for photo” and then on the  
next line “Deleting files for photo”. Im wondering if this is a clue  
to my problem? The surrounding output is below:

Processing SpecController#update (for 127.0.0.1 at 2009-02-05  
23:05:11) [PUT]  
Session ID:  
BAh7CDoJdXNlcmkHOgxjc3JmX2lkIiVlNDdkZjcwNWY0YzViODRlOTZjNGJi  
M2FiMTU4YzMxOCIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6  
OkZsYXNoSGFzaHsABjoKQHVzZWR7AA==–  
be12b27be21dd16e1c3fe915b78e06d0173a08c2  
Parameters: {“commit”=\>“Upload”,  
“authenticity\_token”=\>“0116a623cd3b784f7c81539c52b6e0c04cf0c611”,  
“\_method”=\>“put”, “action”=\>“update”, “spec”=\>{“photo”=\>“Blue-Wild-  
Flower-1-1024x768.jpg”}, “id”=\>“10”, “controller”=\>“spec”}  
User Columns (0.006779) SHOW FIELDS FROM `users`  
User Load (0.028061) SELECT \* FROM `users` WHERE (`users`.`id` =  
2)  
CACHE (0.000000) SELECT \* FROM `users` WHERE (`users`.`id` = 2)  
Spec Load (0.000263) SELECT \* FROM `specs` WHERE (`specs`.user\_id  
= 2) LIMIT 1  
Spec Columns (0.002173) SHOW FIELDS FROM `specs`  
[paperclip] Paperclip attachment photo on Spec initialized.  
SQL (0.001320) BEGIN  
[paperclip] Saving attachments.  
[paperclip] Saving files for photo  
[paperclip] Deleting files for photo  
[paperclip] Writing files for photo  
SQL (0.000070) COMMIT  
CACHE (0.000000) SELECT \* FROM `users` WHERE (`users`.`id` = 2)  
Completed in 0.06918 (14 reqs/sec) | Rendering: 0.00947 (13%) | DB:  
0.03867 (55%) | 200 OK [[http://localhost/spec/10](http://localhost/spec/10)]

This is my controller action(for testing):

def update  
@spec = logged\_in\_user.spec || logged\_in\_user.spec.build(params  
[:spec])  
@spec.update\_attributes(params[:spec])  
end

Anyone have any ideas, this is driving me crazy.

---

<div class="post-metadata">

**Author:** ![david](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/aeb1de/32.png) [@david](https://www.ruby-forum.com/u/david)\
**Post date:** [February 6, 2009, 4:33pm UTC](https://www.ruby-forum.com/t/updating-with-paperclip/159602/2 "2009-02-06T16:33:22Z")

</div>

> “\_method”=\>“put”, “action”=\>“update”, “spec”=\>{“photo”=\>“Blue-Wild-  
> Flower-1-1024x768.jpg”}, “id”=\>“10”, “controller”=\>“spec”}

If you can see the file name and not something like :  
“photo”=\>#ActionController::UploadedStringIO:0xb70611f4

There’s a mistake. Maybe you forgot the multipart on the form?
