I want to upload file by using HTML + javascript.
Although it works, uploaded file name is path name not the file name.
Here is my code to upload file...
HTML
<form id="upload_form" method='POST' enctype='multipart/form-data' action='http://127.0.0.1:8080/upload?Name=' >
file upload: <input type="file" id="file" name="file">
<input type="submit" value="Submit" onclick="UploadFile()"/>
</form>
JavaScript
function UploadFile()
{
document.getElementById("upload_form").action = document.getElementById("upload_form").action + _fileName;
document.getElementById("upload_form").submit();
}
If I choose "C:\Users\Desktop\test5.txt"
The uploaded file name will be "C:UsersDesktoptest5.txt"
How can I change the file name to be "test5.txt" only