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”. The “fakepath” part was actually there – not sure if it’s supposed to be, but this is my first time working with the filename of file uploads.
How can I just get the file name (filename.doc)?
or you could just do (because it’s always
C:\fakepaththat is added for security reasons):