Storing large string from browser

Hi,

I’m getting XML data from a plugin using client side Javascript and
attempting to get it stored off on the server. My first attempt was
updating the value of a hidden form field then storing it away in a
model/table from the controller upon post/put. It turns out the data
frequently takes up more than 65k of space. This is truncating my
data due to row size limitations of MySQL.

I’m looking at Paperclip and CarrierWave as possible ways of storing
the data, but I’m not sure if they are the best solution. I’m running
into these two issues:

  1. Both appear to want files. I’m not sure of the best way to handle
    this. Should I mimic a file/multipart form on the client or store the
    data to a temp file on the host in the controller before handing it
    off to Paperclip/CarrierWave to manage? (I’m not clear on the
    implementation details of either, though am more likely to figure out
    the temp file version quicker)

  2. I need access restrictions and do not wish to place the files under
    public/. Is there an easy way to place it elsewhere, but still offer
    efficient use of resources for download?

BTW, I’m using Rails 3, MySQL, Linux/Apache/Passenger.

Thanks in advance,
Mike