Welcome Guest, Not a member yet? Register   Sign In
send input file info via ajax
#6

If the only problem you have with the page when you submit it without AJAX is that it changes the URL, then you know your server-side code is working properly (barring any errors other than those you have already detailed). It doesn't matter what the code in your controller is, because your JavaScript isn't uploading the file.

AJAX file uploads are a complex issue, which is why I linked you to an outside discussion of those issues. In most cases, you are better off using someone else's file upload code if you want to use AJAX to upload a file (in fact, most of us are better off using someone else's file upload code for every facet of file uploads).

If you choose to use FormData, you accept that it will not work in older browsers or when JavaScript is disabled (unless you code the page to work without it). If you choose to ignore the error message in the JavaScript console, and the explanation of that message which I included in my previous reply, you will likely have a hard time getting AJAX to do much for you.
Reply


Messages In This Thread
send input file info via ajax - by dzoniboj - 02-03-2015, 10:07 AM
RE: send input file info via ajax - by mwhitney - 02-03-2015, 12:56 PM
RE: send input file info via ajax - by dzoniboj - 02-04-2015, 05:43 AM
RE: send input file info via ajax - by mwhitney - 02-04-2015, 08:34 AM
RE: send input file info via ajax - by dzoniboj - 02-04-2015, 08:56 AM
RE: send input file info via ajax - by mwhitney - 02-04-2015, 09:16 AM



Theme © iAndrew 2016 - Forum software by © MyBB