-2

Not Able to Assign value to file uploade control in mvc

<li class="lifile">
 <input type="file" id="fileToUpload" name="file" value="@ViewBag.msg" />
 <span class="field-validation-error" id="spanfile"></span>
 </li>
  • You cannot assign a value to a file input for security reasons. The only way it can be set if by the user selecting a file in the browser –  Oct 28 '16 at 12:21
  • Possible duplicate of [How to set a value to a file input in HTML?](http://stackoverflow.com/questions/1696877/how-to-set-a-value-to-a-file-input-in-html) –  Oct 29 '16 at 00:39

1 Answers1

0

You cannot assign Value to input type = file, for Security Reasons

Maybe This will help How to set a value to a file input in HTML?

Community
  • 1
  • 1
Ajay
  • 5
  • 2