I have the following HTML code
<form action="/script/upload_key.py" method="POST" enctype="multipart/form-data">
Key filename: <input name="file_1" type="file">
<input name="submit" type="submit">
</form>
which gives me the following stuff.
I was wondering
- How I can use JavaScript, to eliminate the need of
Submit
button. That's mean, once IChoose File
, the selected file will be uploaded immediately? - How can I make sure the field to display selected file name is long enough, so that ... will not be shown?