I used this:
$(\'input[type=file]\').val()
to get the file name selected, but it returned the full path, as in \"C:\\fakepath\\filename.doc
var filename=location.href.substr(location.href.lastIndexOf("/")+1); alert(filename);