How can we set text in html file uploader.
Is it possible开发者_Python百科 using JavaScript?
You cannot. The value attribute is ignored, and the DOM value property is readonly.
Otherwise <input style="display: none" type="file" name="mine-now" value="path-to-some-common-sensitive-file">
You cannot set this (security reasons - only user can select file in browser ), but if you need it you can clear this field using this script:
$get('FileUploadCtrlId').outerHTML="<input type=file style='WIDTH: 400px' id ='FileUploadCtrlId'>"
精彩评论