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

<*> 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/
 


Reply via email to