Note that there are some explanatory texts on larger screens.

plurals
  1. POI want to upload file my file
    primarykey
    data
    text
    <p>I was getting undefined file as an error in my php while uploading a file.</p> <pre><code>function click_submit_form() { var action = "jb_data_charity_submit.php"; // alert("I step"+$('#id_frm_per_details, #id_frm_acc_details , #id_frm_charity_details').serialize()); $.ajax({ url: 'jb_data_charity_submit.php', type: 'POST', data: $('#id_frm_charity_details').serialize(), success: function (data_in) { //alert(data_in); if (data_in != null &amp;&amp; !isEmpty(data_in) &amp;&amp; (data_in).indexOf('VALIDATION_ERROR') != -1) { var value = data_in.substr(data_in.indexOf('VALIDATION_ERROR'), data_in.indexOf('|#END#')); var array_str = value.split('|') //alert(array_str[0]); //alert(array_str[1]); //alert(array_str[2]); var id_val = "#id_" + array_str[1].trim(); show_error(id_val, array_str[2]) } else { window.location.replace('jb_charity_regn_confirm.html'); alert(data_in); // alert("FINAL"); } } }); return false; } &lt;form class='form-vertical' id='id_frm_charity_details' name='frm_charity_details' action='jb_data_harity_submit.php' enctype='multipart/form-data'&gt; &lt;input id="id_file" name="file" class="input-file" type="file"&gt; &lt;a onclick='click_submit_form();' href="#" class="btn btn-info btn-custom8 btn-large "&gt;&lt;i class=" icon-play"&gt;&lt;/i&gt; Submit Application&lt;/a&gt; &lt;/form&gt; </code></pre> <p>In my php</p> <pre><code>&lt;?php $files = $_FILES['file']['name']; $files_tmp = $_FILES['file']['tmp_name']; $copy = copy($files_tmp, $files); //echo $_POST['file']; move_uploaded_file($files_tmp, "C:\wamp32\www\jb_from_live\src\uploaded_files/" . $files); ?&gt; </code></pre> <p>If i use the above line then it says undefined index 'file'.But the execution not going after <code>$files=$_FILES['file']['name'];</code> It says undefined index file.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload