File Transfer Through Web Service

TheWizardofInt

Well-known member
Joined
Dec 31, 1969
Messages
333
Location
Orlando, FL
I have a web service that I need to use for file transfer, as well as other things

This code doesnt work because the IO.File doesnt reflect properly. Even if it did, then I wouldnt know what the path of fFile is so that I can copy it.

How should I be handling this?

Code:
<WebMethod()> Public Function UploadPath(ByVal sAuth As String, ByVal sName As String, _
            ByVal fFile As IO.File) As String
        use this method to get an authorization for an upload path
        return the path to upload files to
        Dim sPath As String = Server.MapPath("email.ini")
        Dim sEmAuth As String           authorization
        If IO.File.Exists(sPath) Then
            ////////////////////////////////////////////////////
            //There is a setup.ini                            //
            ////////////////////////////////////////////////////
            Dim sr As New IO.StreamReader(New IO.FileStream(sPath, IO.FileMode.OpenOrCreate))

            While Not sr.Peek
                With clsLogin
                    sEmAuth = sr.ReadLine
                    sPath = sr.ReadLine
                End With
            End While

            sr.Close()
        End If
        compare semauth to sauth
        If sEmAuth = sAuth Then
            If Right(sPath, 1) <> "\" Then
                sPath = sPath & "\"
            End If
            sPath = sPath & sName
            Try
                fFile.Copy(sName, sPath)
                Return "Saved"
            Catch ex As Exception
                Return ex.Message
            End Try
        Else
            Return "<Auth Error>"
        End If

    End Function
 
Back
Top