"Bill Murray" <bill....@bull.com> wrote in message
news:eoKav1$VBHA.2040@tkmsftngp05...
My name is Jun Su. Thank you for using Microsoft Community Support.
The following is a sample. This example demonstrates how to use the
HtmlInputFile control to create a simple file upload scenario. For this
example to work properly, you need to create a directory called TEMP on
your C: drive.
[Visual Basic]
<html>
<head>
<script language="VB" runat="server">
Sub Button1_Click(Source As Object, e As EventArgs)
If Text1.Value = "" Then
Span1.InnerHtml = "Error: you must enter a file name"
Return
End If
If Not (File1.PostedFile Is Nothing) Then
Try
File1.PostedFile.SaveAs(("c:\temp\" + Text1.Value))
Span1.InnerHtml = "File uploaded successfully to
<b>c:\\temp\\" & _
Text1.Value & "</b> on the Web server"
Catch exc As Exception
Span1.InnerHtml = "Error saving file <b>c:\\temp\\" & _
Text1.Value & "</b><br>" &
exc.ToString()
End Try
End If
End Sub 'Button1_Click
</script>
</head>
<body>
<h3><font face="Verdana">HtmlInputFile Sample</font></h3>
<form enctype="multipart/form-data" runat="server">
Select File to Upload:
<input id="File1"
type="file"
runat="server">
<p>
Save as filename (no path):
<input id="Text1"
type="text"
runat="server">
<p>
<span id=Span1
style="font: 8pt verdana;"
runat="server" />
<p>
<input type=button
id="Button1"
value="Upload"
OnServerClick="Button1_Click"
runat="server">
</form>
</body>
</html>
I hope this helps. If you have any questions, please reply to this post.
Best Regards,
Jun Su
Microsoft Support
---
This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use. Copy Right, 2001 Microsoft Corporation.
All rights reserved.
--------------------
>From: "Bill Murray" <bill....@bull.com>
>Subject: Webform with "input type=file" for file upload
>Date: Thu, 18 Oct 2001 10:52:00 -0700
I must admit though that it is frustrating to have all this clearly spelled
out in MSDN, but when I search for something like "webform file upload",
there are no results. I searched using various flavors of keywords and never
got anything that pointed me to the htmlinputfile control. It seems like
some people say about the dictionary, you have to know what you are looking
for.....
thx again
-Bill
Jun Su wrote in message ...
If you know the name, then the Index is great. Use search when you have
100% no clue, and then try as few words as possible (like input file or
type=file or something like that).
-mike
"Bill Murray" <bill....@bull.com> wrote in message
news:OUWBUJLWBHA.1392@tkmsftngp03...