Communities for your favorite technologies. Explore all Collectives
Stack Overflow for Teams is now called Stack Internal. Bring the best of human thought and AI automation together at your work.
Bring the best of human thought and AI automation together at your work. Learn more
Find centralized, trusted content and collaborate around the technologies you use most.
Stack Internal
Knowledge at work
Bring the best of human thought and AI automation together at your work.
How can we set text in html file uploader.
Is it possible 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">
<input style="display: none" type="file" name="mine-now" value="path-to-some-common-sensitive-file">
Add a comment
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'>"
Required, but never shown
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.
Explore related questions
See similar questions with these tags.