Getting $_FILES from input.

Getting $_FILES from input.

Hello,

i have a form with a file upload.

When i click on the submit button i will send the file with $.post to my php script.

In the PHP Script i must use the variable $_FILES[]. How can i realize this?

I try $('form').find("id").get(0).files[0] but it return an object and not $_FILES[].

Can anyone help me?

Source:

$("#cl-entry form").submit(function(event) {
 // Stops submit action
 event.preventDefault();
 var $form = $( this ),
  image = $form.find( 'input[name="image"]' ).get(0).files[0],
  url = $form.attr( 'action' );

 // Send the data using post and put the results in a div
 $.post( url, { image: image} ,
  function( data ) {
   $( "#cl-entry" ).html( data );
  }
 );
});












Kind Regards
Steffen