sarbogast / grails-bootstrap-file-upload

Grails Plugin to integrate Sebastian Tschan's Jquery File Upload
http://grails.org/plugin/bootstrap-file-upload
Apache License 2.0
33 stars 25 forks source link

Problem with formData attribute #7

Open hump opened 12 years ago

hump commented 12 years ago

if using the formData attribute with string values the upload does not work anymore, because you get syntax errors in the generated javascript code.

e.g. formData="[p1:new Date()]"

Fix is to quote the values in line 214 in BootstrapFileUploadTagLib.groovy:

    \$.getJSON(this.action, ${formData ? '{' + formData.collect{k,v->k+':\''+v+'\''}.join(',') + '}' : '{}'}, function (result) {
hump commented 12 years ago

oh, i see this is the nearly the same as issue #6

klemensz commented 11 years ago

Can this be fixed in the library?

nabiltntn commented 11 years ago

I have the same problem with an Id generated by Mongodb plugin ( ObjectId ). My workaround solution