By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,932 Members | 1,454 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,932 IT Pros & Developers. It's quick & easy.

Pass <file> to JavaScript functions along with other form elements

100+
P: 228
I have a small function that accepts form contents and passes them to a php file with post (ajax). Now, i need to include an upload file element in the form and that file be passed to the script so the php file can upload it. It is not been passed at all.

What would be the easiest way to do this?
Mar 26 '12 #1
Share this Question
Share on Google+
2 Replies


Dormilich
Expert Mod 5K+
P: 8,639
Iím not sure you can pass a file in AJAX at all. even regular forms let the browser application handle that (as JS does not have file system access).
Mar 26 '12 #2

acoder
Expert Mod 15k+
P: 16,027
Use an (hidden) iframe and post to it to achieve the same effect as Ajax.
Mar 26 '12 #3

Post your reply

Sign in to post your reply or Sign up for a free account.