Pregunta

I have a grails controller to handle uploaded files.

Now the problem is that i dont know by which name user will upload the file.

request.getFile(fileName)

I dont know the 'fileName'.

Please let me know how to handle anonymous file upload. These files are being uploaded from a javascript rich text editor and the name of the file input is comes different with each request.

Please help.

¿Fue útil?

Solución

you should dump the parmas and inspect which is varible is holding the filename it might not be the varible filename holding the actual file name. so , if u dont have the file name you would have the file handle to proceeed uploading so do as follow :

1.DUMP parmas like

log.debug("Value of Parmas"+parmas.each{it.value()})

or

  println("Value of Parmas"+parmas.each{it.value()})

on your console window or what ever using the browser look for a common name that you will use further to get the file handle usually called 'filename'.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top