briankam
asked on
Submit ColdFusion form with data and input type=file
I have a html coldfusion data entry form in a coldbox framework and using jQuery instead of javascript. I submit the form with many input fields along with an input type=file. The form tag has enctype="multipart/form-da ta" method=”post”. The form will not submit.
No errors come up when I click submit (but the jQuery does run), it just will not submit the form or go into the cffunction. When I remove the type=file from the form and the enctype="multipart/form-da ta" from the form tag, the form submits.
Is there a plugin in for coldbox that I am missing or is there a jQuery function that I need to add?
Thank you very much
No errors come up when I click submit (but the jQuery does run), it just will not submit the form or go into the cffunction. When I remove the type=file from the form and the enctype="multipart/form-da
Is there a plugin in for coldbox that I am missing or is there a jQuery function that I need to add?
Thank you very much
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
To upload the file use this in the page your form submits to:
<CfFile Action="UPLOAD" FileField="fname" NameConflict="overwrite" Destination="#destination# ">
where fname is the name of the formfield with type=file.
As for the form not submitting via the submit button, are you sure you aren't getting any JS errors? Have you tried using Firefox with the Firebug addon to test it for errors.
Can you post your code for the form page?
<CfFile Action="UPLOAD" FileField="fname" NameConflict="overwrite" Destination="#destination#
where fname is the name of the formfield with type=file.
As for the form not submitting via the submit button, are you sure you aren't getting any JS errors? Have you tried using Firefox with the Firebug addon to test it for errors.
Can you post your code for the form page?
CFFile and CFFunction are both server side actions AFTER the form submit was initiated.
It is not possible to SET the value of file field.
I assume that some file field checking script has some access or syntax errors and therefore the onSubmit return code is false and the submit action is blocked.
Is you page accessible online?
It is not possible to SET the value of file field.
I assume that some file field checking script has some access or syntax errors and therefore the onSubmit return code is false and the submit action is blocked.
Is you page accessible online?
ASKER
This comment led us to debug our problem
Otherwise you could upload my creditcard.,txt and my password.txt to your server.
Upload is allowed ONLY manualy by user click on submit button and not by script.
And do not tell me that Google is able to do it. I know...