1.アップロードファイルの選択<form id="Form1" method="post" runat="server" enctype="multipart/form-data">
<INPUT type="file" name="userfile">
<asp:Button id="Button1" runat="server" Text="送信" />
</form>
2.VB.NETでファイルを取り出し、保存するPrivate Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim posted As HttpPostedFile = Request.Files("userfile")
If Not posted.FileName = "" Then
posted.SaveAs("c:UploadedFiles" & system.IO.Path.GetFileName(posted.FileName))
End If
End Sub
3.web.configの編集 最大ファイルサイズとタイムアウトの設定<?xml version="1.0" encoding="UTF-8" ?>
タイムアウト
<configuration>
<location path="upload.aspx">
<system.web>
<httpRuntime
maxRequestLength="10000" 'ファイルサイズ
executionTimeout="180" '
</system.web>
</location>
</configuration>