javascript - sending other input with $_FILES php -


I am uploading a file using the following jquery ..

  function Ajax file upload (job) {$ ("# loading") .jaxstart (function () {$ (this). Show ();}). Jax full (function () {$ (this) .hide (); }); $ .ajaxFileUpload ({url: 'addjobrpc.php', secure: incorrect, job id: job, file element id: 'filetupload', datatype: 'jason', success: function (data, position) {$ ('# imaged'). Val (data.imageid); if (typeof (data.error)! = 'Undefined') {if (data.error! = '') {Alert (data.error);} else {alert (data.msg); }}}, Error: function (data, position, e) {warning (e);}}) return false;  

My form looks like this ...

  & lt; Form name = "form" action = "" method = "post" enctype = "multipartile / form-data" & gt;  

I get the file name with $ $ FILES ['fileToUpload'] ['name']; But how do I get an input that is not part of a file upload? For example Jobid is a hidden field but I can not find the value in addjobrpc.

Thanks

I'm not familiar with this plugin, but the quick look at the source After seeing from it it seems that it is not able to send any additional post data.

Instead, which allows you to do something like this:

  New Ajax Upload ('# upload_button_id', {action: 'addjobrpc.php', name: 'FileToUpload', // Data to send additional data: {Job ID: jabid}, // Submit the file automatically after submitting: Correct, Reaction type: "JSON", FINAL: & lt; success function here Goes & gt;});  

You can then use $ _ POST ['Job ID'] to retrieve data on the server.


Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

php - Multiple Select with Explode: only returns the word "Array" -

php - jQuery AJAX Post not working -