c# - fakepath while File Upload -
i using jquery upload file on server gets replaced fakepath :
my path should "c:\users\download\filename.xls" gets replace "c:\fakepath\filename.xls"
i used approach solve above problem :
var selectedpath = $('input#filedata_file').val().split('\\').pop();
//filename.xls
but gives filename , eliminates path , how fullpath filename.
var srccontent; // give file function readurl(input) { if (input.files && input.files[0]) { var reader = new filereader(); reader.onload = function (e) { srccontent = e.target.result; } reader.readasdataurl(input.files[0]); } } $("#inputfile").change(function () { if (this.files[0].name != "") { readurl(this); } });
Comments
Post a Comment