вы можете использовать FormData
$("#add_product").click(function(e){
e.preventDefault();
var fdata = new FormData()
fdata.append("product_name",$("product_name").val());
if($("#file")[0].files.length>0)
fdata.append("file",$("#file")[0].files[0])
//d = $("#add_new_product").serialize();
$.ajax({
type: 'POST',
url: 'ajax.php',
data:fdata,
contentType: false,
processData: false,
success: function(response)
{
//
alert(response);
}
})
});
<!-- File Button -->
<div class="form-group">
<label class="col-md-4 control-label" for="file">Upload Software / File</label>
<div class="col-md-4">
<input id="file" name="file" class="input-file" type="file">
</div>
</div>
<div class="form-group">
<label class="col-md-4 control-label" for="price">Price($)</label>
<div class="col-md-4">
<input id="price" name="price" type="text" placeholder="Price" class="form-control input-md" required="">
</div>
</div>
Система. Глобализация. CultureInfo. CurrentCulture. TextInfo. ListSeparator
Является единственным способом, которым я знаю как.