View Single Post
  #22 (permalink)  
Old March 10th, 2007, 09:53 AM
grstad grstad is offline
Friend of Wrox
 
Join Date: May 2005
Location: , , Norway.
Posts: 189
Thanks: 0
Thanked 0 Times in 0 Posts
Default

... but the txtfile is an binary-file, is it not? May be the validation schould be incorporated with the "save to database"-line...

<%
    Public Sub SaveToDisk(sPath)
        Dim oFS, oFile
        Dim nIndex

        If sPath = "" Or FileName = "" Then Exit Sub
        If Mid(sPath, Len(sPath)) <> "\" Then sPath = sPath & "\"

        Set oFS = Server.CreateObject("Scripting.FileSystemObject")
        If Not oFS.FolderExists(sPath) Then Exit Sub

        Set oFile = oFS.CreateTextFile(sPath & FileName, True)

        For nIndex = 1 to LenB(FileData)
            oFile.Write Chr(AscB(MidB(FileData,nIndex,1)))
        Next

        oFile.Close
    End Sub

    Public Sub SaveToDatabase(ByRef oField)
If LenB(FileData) = 0 Then Exit Sub
        If IsObject(oField) Then
            oField.AppendChunk FileData
        End If
    End Sub
%>


instead? Does this matter?

Mvh
grstad
Reply With Quote