oh ... and this is the HTML for that submit button
<form id="fmImageManager" method="post" runat="server"
enctype="multipart/form-data">
<table width="100%" cellpadding="0"
cellspacing="5">
<tr>
<td class="StandardBoldBigger">
<img
src="./../images/global/spacer.gif" width="15" height="20"
border="0">FILE
MANAGER
</td>
<td align="right">
<a
href="FileManager.aspx?Page=<%= sRefPage %>&Element=<%= sElement
%>">back</a><img src="./../images/global/spacer.gif" width="10"
height="1" border="0">
</td>
</tr>
<tr bgcolor="#e5e5e5">
<td class="StandardBold"
colspan="2" valign="middle">
<img
src="./../images/global/spacer.gif" width="20" height="15">Add File
</td>
</tr>
<tr>
<td colspan="2"> </td>
<tr>
<tr>
<td colspan="2">
<table width="95%"
align="center">
<tr>
<td
class="StandardBold" valign="top">File Category</td>
<td><asp:DropDownList
Runat="server" ID="cboFileCategory"></asp:DropDownList></td>
</tr>
<tr>
<td
class="StandardBold" valign="top">File Name</td>
<td><input
id="filFile" type="file" runat="server" class="button"
NAME="filImage"></td>
</tr>
<tr>
<td
class="StandardBold" valign="top">File Description</td>
<td>
<asp:TextBox
ID="txtFileDesc" Columns="40" Rows="10" Runat="server"
TextMode="MultiLine"></asp:TextBox></td>
</tr>
<tr>
<td
class="StandardBold" colspan="2" align="center"><br>
</td>
</tr>
<tr>
<td
colspan="2"><br>
</td>
<tr>
<tr
borderColor="#ffffff">
<td
id="tdButtons" align="center" colSpan="2">
<asp:button
id="btnSubmit" Runat="server" CssClass="Button" Text="Submit"
CommandName=""></asp:button> <asp:button id="btnReset"
Runat="server" CssClass="Button" Text="Reset"
CommandName=""></asp:button>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td colspan="2"><br>
<br>
</td>
<tr>
<td colspan="2" align="center">
<asp:Image
id="imgWorking" Runat="server"></asp:Image>
<asp:Label
id="lblMessage" runat="server"></asp:Label>
</td>
</tr>
</table>
</form>
>>> [EMAIL PROTECTED] 05/27/2005 10:42:49 AM >>>
try this ...
Private Sub btnSubmit_Click(ByVal sender As Object, ByVal e As
System.EventArgs) Handles btnSubmit.Click
Dim strFileName As String
Dim strFilePath As String
Dim strFolder As String
Dim bRetVal As Boolean
Dim oConn As OracleConnection
Dim sSQL As String
Dim iExtensionID As Integer
lblMessage.Visible = False
Try
strFolder = Request.PhysicalApplicationPath & "Files\FileManager\"
'Get the name of the file that is posted.
' 1 MegaByte = 1048576 bytes
' 50 MegaBytes = 52428800 bytes
If filFile.PostedFile.InputStream.Length >= 52428800 Then
' show error ... file is too big
lblMessage.Visible = True
lblMessage.CssClass = "StandardRedBold"
lblMessage.Text = "ERROR: AddFile.btnSubmit_Click<BR>File
Size
is too large.<BR>Files must be smaller than 50 MB in size."
Exit Sub
End If
strFileName = filFile.PostedFile.FileName
strFileName = Path.GetFileName(strFileName)
'Create the directory if it does not exist.
If (Not Directory.Exists(strFolder)) Then
Directory.CreateDirectory(strFolder)
End If
'Save the uploaded file to the server.
strFilePath = strFolder & strFileName
'If File.Exists(strFilePath) Then
'lblMessage.Text = strFileName & " already exists on the server!"
'Else
iExtensionID = ReturnExtensionID(strFileName,
ConfigurationSettings.AppSettings("ConnectionString"))
If iExtensionID > 0 Then
filFile.PostedFile.SaveAs(strFilePath)
oConn =
CreateOraConn(ConfigurationSettings.AppSettings("ConnectionString"))
sSQL = "INSERT INTO lnkFile
(FileID,FileName,FileCategoryID,FileDescription,InsertDate,FileExtensionID)
VALUES (SEQ_FILEID.nextval,'" & MakeNiceInput(strFileName) & "'," &
cboFileCategory.SelectedValue & ",'" & MakeNiceInput(txtFileDesc.Text)
&
"',To_Date('" & Format(Now(), "Short Date") & "','MM/DD/YYYY')," &
iExtensionID & ")"
bRetVal = performQuery(sSQL, oConn)
oConn.Close()
oConn.Dispose()
If bRetVal Then
Response.Redirect("FileManager.aspx?Page=" & sRefPage)
Exit Sub
Else
imgWorking.Visible = False
lblMessage.Visible = True
lblMessage.CssClass = "StandardRedBold"
lblMessage.Text = "ERROR: AddFile.btnSubmit_Click<BR>Errors were
encountered inserting this file."
Exit Sub
End If
Else
imgWorking.Visible = False
lblMessage.Visible = True
lblMessage.CssClass = "StandardRedBold"
lblMessage.Text = "ERROR: AddFile.btnSubmit_Click<BR>Invalid file
type.<BR>The selected file type not found in list of acceptable file
types."
Exit Sub
End If
'End If
'Display the result of the upload.
'frmConfirmation.Visible = True
Catch ex As Exception
imgWorking.Visible = False
lblMessage.Visible = True
lblMessage.CssClass = "StandardRedBold"
lblMessage.Text = "ERROR: AddFile.btnSubmit_Click<BR>Errors were
encountered inserting this file.<BR>" & ex.Message
Exit Sub
End Try
End Sub
>>> [EMAIL PROTECTED] 05/27/2005 3:35:20 AM >>>
Hi
using FileSystemObject can i copy a file from my loacal machine to any
server (in Classsic Asp)?
if yes...then how ?
in my serever, there is no component for file uploading ....
i have to do this by using filesystem object,
(dont recommend to binary write in SQL please ..)
HOW do i do do that ?
Thanks in Advance
Arindam
Thanks & Regards
Arindam
Web Designer & Developer
Yahoo! India Matrimony: Find your life partneronline.
[Non-text portions of this message have been removed]
Yahoo! Groups Links
[Non-text portions of this message have been removed]
Yahoo! Groups Links
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/