There are two components to your question, so I'll break it up.
How can I add a cancel button next to the upload button
According to the W3C spec, a form can only have one button within the
<form></form> tags that submits the form params. As long as you don't need
to carry along the form params on your cancel, the easiest way to do what
you're wanting is to use a button_to outside your form tags and then use CSS
to position it, from a visual perspective, along-side the submit button and
make it _appear_ to the user that side the form has two buttons.
which will stop the uploading of multiple files, and how would it be done?
If you mean 'stop the uploading after its been started', this is a tough one
and I'm not aware of any built-in support in either Ruby or Rails for doing
it. It's a good question though. I know the capability is built into other
tools, so there must be a way to do it. Maybe someone else will be able to
help with this. It's definitely interesting. I'll cipher on it and see if
I can come up with something.
Thanks for reply. Yes, I meant to be stop the uploading after it's been
started. I did some search, but comes with no rails solution. Flash is
an alternative way to do it. Well, last time I use Flash was 7 years
ago...
buttons
Authors may create three types of buttons:
submit buttons: When activated, a submit button submits a form. A
form may contain
more than one submit button.
There is no solution with normal form submits, and you don’t need to know anything about Flash to use a Flash uploader. Go check on swfupload.org and search the list archives for a post i made about SWFUpload and Rails.
There is no solution with normal form submits, and you
don't need to know anything about Flash to use a Flash
uploader. Go check on swfupload.org and search the list
archives for a post i made about SWFUpload and Rails.
That's cool. Looks like something I'll want to add to my toolkit. I
_would_ like to understand how it's done though. I haven't been able to
come up with the right search string for Google. Nothing gets me to the
protocol definition type stuff I'm expecting looking for. Can you point me?