Alternative cffile, I need to upload without submit form

So, I want to upload a file to the server using ajax, so the form will not be submitted. Cffile requests the filefield attribute, but since the form object is not passed to coldfusion, this does not work. I can save the value entered by the user as a variable in javascript and pass this variable to cf. How can I use this variable to upload my file? Thank.

EDIT Solved by sending in iframe.

+1
source share
3 answers

Submit the form to a hidden iframe and handle loading your form as usual.

0
source

cffileupload ( Flash ) XMLHttpRequest level 2 ( ) .

+2

All Articles