c# - asp.net FileUpload 'open' click to copy title -


i using asp.net fileupload control upload files. there 'title' text box allows user enter file title well. 'upload' button uploads file server. working fine. problem that, customer has asked copy file name automatically title 'text box' in case user wants custom title same file name.

unfortunately, unable figure 1 out. thought there event behind 'open' button of file upload, tap , title gets displayed on fileupload control, should displayed on title text box field. perhaps javascript/jquery might help.

any in right direction appreciated. many thanks

you can use input's change event jquery:

$(function () {     $('input:file').on('change', function () {         console.log($(this).val());     }) }) 

you have parse value remove "fakepath" stuff browsers add.

you can using split method:

var title = $(this).val().split('\\'); console.log(title[title.length - 1]) 

Comments

Popular posts from this blog

google api - Incomplete response from Gmail API threads.list -

Installing Android SQLite Asset Helper -

Qt Creator - Searching files with Locator including folder -