On Oct 20, 2012, at 6:17 AM, akvarel wrote:

> I have uploading several file working already. The problem is that I want to 
> make a oreview before uploading.
> I have studied as well the code of JQuery Upload. I have copied and pasted 
> the content of all their pages and files. The problem is I cannot add the 
> files because the "action" is really strange:
> <!-- The file upload form used as target for the file upload widget -->
>     <form id="fileupload" action="server/php/" method="POST" 
> enctype="multipart/form-data">
>         <!-- The fileupload-buttonbar contains buttons to add/delete files 
> and start/cancel the upload -->
> 
> 
> 
> They do not have a controller with a function server/php , but they do have a 
> folder server/php with other files. I have downloaded this folder and added 
> it to my rails project, but I have no idea how I can link 
> action="server/php/" with that folder.

You're not, not unless you put it in the /public folder, and configure Apache 
to run the PHP interpreter against it. I have heard of this sort of thing being 
possible, but I have never attempted it. 

If you already have file upload working with Rails, then there's no reason to 
add the form tag as they have here, just learn from it. Think of this as the 
working model that you must adapt from PHP to Rails. Change action to your file 
upload action, or just add the ID of this example form to your Rails form_for 
method. Then fold in the JavaScript that they use to make the preview, and you 
should be good. If they are doing a client-side preview, then the form handler 
(PHP or Rails) is completely outside of the problem, not related at all to the 
solution.

Walter

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to