Hi all,
This piece of code retrieves the full path of where the file is located. How can I make it retrieve the filename and not the full path?
Code:
<form method="post" enctype="multipart/form-data" name="ddd">
file: <input type="file" name="filename" id="filename" />
<p>find out value of file. click --> <input type="submit" name="submit" value="find out" onclick="alert(document.getElementById('filename').value);return false;" /></p>
</form>
The value returned will be something like C:/My Documents/New Folder/image.jpg.
I want to get the "image.jpg" only.
|