httpfilecollection files = HttpContext.Current.Request.Files;
If files return results are always incorrect
WORKAROUND: You must add the Name property to the file control
<script type= "Text/javascript" >
function AddFile () {
var str = ' <div class= "R_c_column" ><div class= "R_c_left" > Please select Picture: </div><div class= "R_c_right" > <input type=file name=file runat=server style=width:300px/></div></div> ';
document.getElementById (' FileList '). insertAdjacentHTML ("BeforeEnd", str);
$ ("#FileList"). html (str);
}
</script>
document.getElementById (' FileList '). insertAdjacentHTML ("BeforeEnd", str):
Adding HTML content and text content before using the innerHTML and InnerText methods, and recently found insertAdjacentHTML and insertAdjacentText methods, both of which are more flexible, You can insert HTML content and text content in the specified place.
1. Beforebegin: Insert before the label starts
2. Afterbegin: After inserting the tag start tag
3. BeforeEnd: Before the tag end tag
4. Afterend: After inserting the tag end tag
HttpContext.Current.Request.Files