我有一个 Asp.net 页面,您可以从中上传我需要在代码隐藏中处理和上传的图片。现在,如果我尝试获取所有上传的文件, Request.Files我的计数为 0。如果我使用 javascript 检查,那么它确实告诉我有一个文件,那么我怎样才能在代码隐藏中获取该文件?
ASP.NET 代码
<div class="custom-file">
<input type="file" ID="FileUploadPictureStudent" class="custom-file-input"
aria-describedby="FileUploadPictureStudent"name="FileUploadPictureStudent" runat="server"
onchange="fileUploadhandeler(this);" />
<asp:Label runat="server" class="custom-file-label" for="FileUploadPictureStudent" Text="Choose file" ID="Fileuploadhelper"></asp:Label>
</div>
VB.Net代码
Dim HelperLabel = Request.Files.Count.ToString()
输出页为 0
document.getElementById('FormViewAddStudent_FileUploadPictureStudent').files在控制台中使用命令输出 Javascript
FileList {0: File, length: 1, item: function} = $1
提前致谢