1

How can we set text in html file uploader.

Is it possible using JavaScript?

0

2 Answers 2

3

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">

Sign up to request clarification or add additional context in comments.

Comments

0

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'>"

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.