Code running on the server cannot access files on the client.
Javascript code running in the browser can only access files that the user explicitly selects, using a file input control.
Chrome supports adding a
directory
attribute to a file input, which will allow the user to select a directory. All files within that directory will then be uploaded to the server.
Other browsers do not support the
directory
attribute. Instead, you will need to rely on the
multiple
attribute to allow the user to select multiple files to upload.
<asp:FileUpload id="Files" runat="server"
AllowMultiple="True"
directory
/>
if (Files.HasFiles)
{
foreach (HttpPostedFile file in Files.PostedFiles)
{
}
}