var filename = $('input[type=file]').val().split('\\').pop();
or you could just do (because it’s always C:\fakepath
that is added for security reasons):
var filename = $('input[type=file]').val().replace(/C:\\fakepath\\/i, '')
More Related Contents:
- How to pass parameters in GET requests with jQuery
- How can I get the title of a webpage given the url (an external url) using JQuery/JS
- how to use json file in html code
- Use jQuery to get session from Minecraft.net [duplicate]
- Split string into 2 elements [closed]
- How to capture the browser window close event?
- How to get hex color value rather than RGB value?
- Is there a link to the “latest” jQuery library on Google APIs? [duplicate]
- Find and remove objects in an array based on a key value in JavaScript
- What is the right way to use Jquery in React?
- How can I prevent the backspace key from navigating back?
- Javascript Array Concat not working. Why?
- ReactJS SyntheticEvent stopPropagation() only works with React events?
- Debugging scripts added via jQuery getScript function
- I want to do animation of an object along a particular path
- Is there any “on DOM change” event? [duplicate]
- jQuery – select all text from a textarea
- How can I refresh the screen on browser resize?
- Highlight current page in jquery
- Chart.js v2: How to make tooltips always appear on pie chart?
- Select values of checkbox group with jQuery
- Submit form using AJAX in Asp.Net mvc 4
- Print repeating Page headers in Chrome [closed]
- Scrolling Overflowed DIVs with JavaScript
- Not able to launch a pdf file in inappbrowser in android
- Immediately-Invoked Function Expression (IIFE) In JavaScript – Passing jQuery
- How to capture browser close event?
- Crop image white space automatically using jQuery
- document.documentElement.scrollTop return value differs in Chrome
- customize highcharts tooltip to show datetime