Browsers are designed in such way because of security risks. It’s impossible to set value of file input box in HTML source or by Javascript. Otherwise malicious script could steal some private file without user attention.
There is an interesting information about the subject.
More Related Contents:
- How to handle checkboxes in ASP.NET MVC forms?
- MVC post a list of complex objects
- Possible bug in ASP.NET MVC with form values being replaced
- Submitting form and pass data to controller method of type FileStreamResult
- How to get ELMAH to work with ASP.NET MVC [HandleError] attribute?
- Polymorphic model binding
- MVC DateTime binding with incorrect date format
- TempData keep() vs peek()
- ASP.NET MVC – View with multiple models
- Razor-based view doesn’t see referenced assemblies
- Why is my CSS bundling not working with a bin deployed MVC4 app?
- There is no ViewData item of type ‘IEnumerable’ that has the key ‘xxx’
- ASP.NET: This method cannot be called during the application’s pre-start initialization stage
- Could not load file or assembly HRESULT: 0x80131515 (When adding controller to MVC project that has assembly references on network drive)
- Server cannot set status after HTTP headers have been sent IIS7.5
- AWS Elastic Beanstalk environment variables in ASP.NET Core 1.0
- How do you set the startup page for debugging in an ASP.NET MVC application?
- Entity Framework Include OrderBy random generates duplicate data
- How to handle DBContext when using Ninject
- How does a method in MVC WebApi map to an http verb?
- Pass Model To Controller using Jquery/Ajax
- how to gzip content in asp.net MVC?
- Why is ValidateInput(False) not working?
- Html.DropDownList – Disabled/Readonly
- Inject repository to custom membership provider with Ninject
- IIS Express — Getting SSL to Work
- Where are @Json.Encode or @Json.Decode methods in MVC 6?
- Hiddenfor not getting correct value from view model
- Routing in Asp.net Mvc 4 and Web Api
- How can I create a route constraint of type System.Guid?