i use this tutorial as my reference , to do multiple upload but the method in button is not call at all
http://www.aspsnippets.com/Articles/Uploading-Multiple-Files-using-JavaScript-Dynamic-FileUpload-Controls-in-ASP.Net.aspx
however i find out that i was not able to call the save as code in the button as the i use a default.aspx with a master page, so in the contentplaceholder i not able to place this enctype="multipart/form-data in it skip all this code
For i As Integer = 0 To Request.Files.Count - 1
Dim PostedFile As HttpPostedFile = Request.Files(i)
If PostedFile.ContentLength > 0 Then
Dim FileName As String = System.IO.Path.GetFileName(PostedFile.FileName)
PostedFile.SaveAs(Server.MapPath("Files\") + FileName)
End If
Next
so how what should i do ? i cannot change it in the master page as it will affect other aspx so where or what should i do to allow me to call this above method to work
<span style ="font-family:Arial">Click to add files</span>
<input id="Button1" type="button" value="add" onclick = "AddFileUpload()" />
<br /><br />
<div id = "FileUploadContainer">
<!--FileUpload Controls will be added here -->
</div>
<br />
<asp:Button ID="btnUpload" runat="server"
Text="Upload" OnClick="btnUpload_Click" />
<script type = "text/javascript">
var counter = 0;
function AddFileUpload()
{
var div = document.createElement('DIV');
div.innerHTML = '<input id="file' + counter + '" name = "file' + counter +
'" type="file" />' +
'<input id="Button' + counter + '" type="button" ' +
'value="Remove" onclick = "RemoveFileUpload(this)" />';
document.getElementById("FileUploadContainer").appendChild(div);
counter++;
}
function RemoveFileUpload(div)
{
document.getElementById("FileUploadContainer").removeChild(div.parentNode);
}
</script>