Sebtm
Sebtm

Reputation: 7164

Plupload works with Ruby on Rails?

I tried following the example at: http://www.plupload.com/example_custom.php

But in the request, file is not sent to the method of the controller, only the name.

Maybe I need to set in the configuration of Plupload, something like 'multipart = true'

Any idea?

Upvotes: 4

Views: 1541

Answers (5)

Jason Torres
Jason Torres

Reputation: 21

The question was ages ago. But will answer for other people looking for a solution.

The solution for this is adding "multipart : true" on your pluploadQueue({}) function. That would send the file as multipart. For multiple files, it will send/POST the request multiple times. Then you can handle that on your controller.

Hope this helps.

Jas

Upvotes: 2

Simon B.
Simon B.

Reputation: 2706

A few "any" ideas... :-p

  1. Is there any chance the file you try to upload gets filtered by some security feature in Rails, the rails-proxying server (apache?), or even some software on clientside?

  2. Did you try different browsers, to verify it's not a clientside problem? (sniffing your network connection could be another way to verify that the file actually gets sent to the server)

  3. If you happen to be using rack, then there is some middleware that can take care of file uploads for you. Not what you wanted, but perhaps useful as a temporary workaround while waiting in case you'd discover you have to wait for some bugfixing in rails or plupload.

  4. Permissions on the folder where uploaded files are supposed to go? Or do they go in memory first, and write to disk later? Maybe the plupload library uses temporary files somewhere and the permissions aren't working out there.

Upvotes: 0

Joshua Pinter
Joshua Pinter

Reputation: 47481

Can we see some more code. There's a lot that could be going wrong.

Also, can you use debugger after the form submission and post a params output here?

J

P.s. By the way, tried to make this a comment but no go...

Upvotes: 0

Ram on Rails
Ram on Rails

Reputation: 1369

W3C states this for file upload...

 <FORM action="http://server.com/cgi/handle"
       enctype="multipart/form-data"
       method="post">
   <P>
   What is your name? <INPUT type="text" name="submit-name"><BR>
   What files are you sending? <INPUT type="file" name="files"><BR>
   <INPUT type="submit" value="Send"> <INPUT type="reset">
 </FORM>

Upvotes: 0

Attila Gy&#246;rffy
Attila Gy&#246;rffy

Reputation: 759

I have no experience with Plupload I don't think you should have to explicitly deal with multipart uploads in the plugin configuration. (That is a file uploader library after all.) Don't get me wrong but do you have the multipart attribute set to true in the html markup?

Upvotes: 1

Related Questions