|
分類:[ASP.NET (VB)]
<form id="Form1" method="post" enctype="multipart/form-data" runat="server"> Select File1:<br /> <asp:FileUpload ID="FileUpload1" runat="server" /> <br /> Select File2:<br /> <asp:FileUpload ID="FileUpload2" runat="server" /> <br /> <asp:Button ID="submit" runat="server" Text="アップロード" /> <br /> </form> Sub SubmitButton_Click(ByVal Source As Object, ByVal e As EventArgs) Handles submit.Click Dim filepath As String = "C:\Uploads" Dim uploadedFiles As HttpFileCollection = Request.Files Dim i As Integer = 0
Do Until i = uploadedFiles.Count Dim userPostedFile As HttpPostedFile = uploadedFiles(i) If (userPostedFile.ContentLength > 0) Then userPostedFile.SaveAs(filepath & "\" & _ Path.GetFileName(userPostedFile.FileName)) End If i += 1 Loop End Sub
userPostedFile.SaveAsで保存してるのですが、C:\Uploadsにファイルがありません。
|