I am doing form serialization to send the file name to the server. This serialization values is empty . I am expecting the file name over here.
My form is having a html file upload element. Which shows the file name in the right side when you select the file.
HTML:
<form name="MyForm" id="MyForm" method="post" action=cgi_path">
<input type="file" name="filename" id="my_file">
</form>
SCRIPT:
var frm_data = $("#MyForm").serialize(); // This is empty
$.ajax(
{
type: "POST",
url: "file upload cgi url",
data: frm_data
});
- How to take the file name with out serializing this form?
- Is there any problem with form serialization for file name?
Thanks