# Paperclip - possible to modify file and load file content as string?

**URL:** <https://www.ruby-forum.com/t/paperclip-possible-to-modify-file-and-load-file-content-as-string/193710>\
**Category:** Rails\
**Created:** [August 23, 2010, 1:52am UTC](https://www.ruby-forum.com/t/paperclip-possible-to-modify-file-and-load-file-content-as-string/193710 "2010-08-23T01:52:05Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ntk](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/n/48db29/32.png) [@ntk](https://www.ruby-forum.com/u/ntk)\
**Post date:** [August 23, 2010, 1:52am UTC](https://www.ruby-forum.com/t/paperclip-possible-to-modify-file-and-load-file-content-as-string/193710/1 "2010-08-23T01:52:05Z")

</div>

Wanted to see if anyone knows of a way - or the preferred way - to do  
these  
three tasks with Paperclip:

1. Access the content of an uploaded file before save. I did find that  
the  
following works before save, but is there a clearer way to do this:

self.uploaded\_file.queued\_for\_write[:original].open.read

1. Access the content of a file after save while my AR model instance is  
still alive and/or when I load a record and need the file content. i.e.  
do I  
just need to manually read the file into my object from the Paperclip  
path,  
or is there a direct method in Paperclip to do this?

2. (if #2 above is possible), is there a way I can modify the file  
content  
and if so, does calling object.save on the Paperclip enabled object  
after a  
change save the changes?

Paperclip seems to make everything easy but I can’t seem to find a  
direct  
way to do these tasks. Maybe it was not really designed for what I am  
trying  
to do but is gets me pretty far along.

Thanks in advance,

David
