I have an application which allow user upload documents to Scribd. I tried to use scribd_fu in Rails. An error occurred when the controller try to save the model.
NoMethodError in DocumentsController#processupload
private method `gsub' called for nil:NilClass
here is the related controller
def processupload
@document = Document.new(params[:document])
if @document.save
session[:scribdid] = @document.ipaper_access_key
else
xxxxx
and this is the related html form
<form action="/documents/processupload" enctype="multipart/form-data" method="post">
<input name="authenticity_token" type="hidden" value="FqTCmlGGIvRjiaiaa+YtF50wgI7FfpxfrZsulLCbXcw=" />
<label class="label_h2">Upload a Document</label>
<input id="document_document_upload" name="document[document_upload]" size="30" type="file" /></div>
<div class="buttons"><button type="submit" class="positive"><img src="/images/icons/tick.png" alt="Save Document"/>Save Document</button>
</form>
Is there anything wrong?
I'd ensure the mimetype of the document you're trying to upload is supported by ScribdFu. That's usually the biggest cause of an error. (I wrote ScribdFu :))