JS - get filename with Ajax
<p>I am trying to get the extension and name of a file using Ajax.</p>

<p>My ajax code looks like:</p>

<pre><code>$.ajax({
    type: "POST",
    url: url,
    data: $("#updateMember").serialize(), 
    mimeType: "multipart/form-data",
    contentType: false,
    cache: false,
    processData: false,
    success: function (data) {
        alert(data);
    }
});
</code></pre>

<p>In PHP I have this </p>

<pre><code>$imageFileType = pathinfo($_FILES["input9"]["name"], PATHINFO_EXTENSION);
echo $imageFileType;
</code></pre>

<p>and my html is</p>

<pre><code>&lt;form method="post" enctype="multipart/form-data" id="updateMember"&gt;
    &lt;input id="input-9" name="input9" type="file" class="file file-loading" data-allowed-file-extensions='["png", "jpg", "gif", "jpeg"]' style="top: 0px;"&gt;
    &lt;li class="menu__item"&gt;&lt;input name="offerUpload" id="dashOffersBtn" class="menu__link menu_input btnDashboard" style="margin: 0 auto; height:20px;padding: 0;padding-bottom: 22px;width: 70%;" type="button" value="SAVE"&gt;&lt;/li&gt;
&lt;/form&gt;
</code></pre>

<p>but it seems to not work. What am I doing wrong?</p>