New Message on dotNET User Group Hyd

FTP using VB.net problem

Reply
  Reply to Sender   Recommend Message 1 in Discussion
From: hemadotnet

Hi Folks,
 
      This is very very urgent please help me some one who have an idea.I want upload file using VB.net Program to Some directory level in virtual directoty(ASP.net web application)For that i am using .
Function UploadFile(ByVal sDocName As String) As Boolean
Dim fgConnect As Boolean

Dim iOrder As Integer

Dim objFTP As New DYNULib.FTP()

Try

fgConnect = objFTP.Connect(System.Configuration.ConfigurationSettings.AppSettings("ftpHost"), "XFSuser", "user")

If (fgConnect = True) Then

'Here working Fine

objFTP.ChangeDirectory("/UserArea/Folder" & g_User_ID)

If IsNothing(g_objXMLFileDoc) Then

OpenXMLFile(g_sXMLFilePath)

End If

If sDocName <> "" Then

Dim objeleDoc As XmlNode

objeleDoc = g_objXMLFileDoc.SelectSingleNode("/Documents/DOCUMENT/Document_Name[text()='" & sDocName & "']")

If Not IsNothing(objeleDoc) Then

Dim objFilesNode As XmlNodeList

objFilesNode = objeleDoc.ParentNode("Files").ChildNodes

If objFilesNode.Count > 0 Then

Dim objFileNode As XmlNode

Dim objSrvc As New XFSUploadService.Service1()

For Each objFileNode In objFilesNode

iOrder = iOrder + 1

Dim RemoteFile, LocalFile As String

LocalFile = g_sApplicationPath & "\USERAREA\Folder" & g_User_ID & "\PreparedDocs\" & objFileNode.InnerText

RemoteFile = objFileNode.InnerText

Dim bStatus As Boolean = objFTP.PutFile(LocalFile, RemoteFile)

'Here BStatus become False what is the reason

If bStatus = True Then

objSrvc.InserDocumentInfo(g_User_ID, objFileNode.InnerText, iOrder, sDocName)

End If

Next

objSrvc.Dispose()

Else

MsgBox("Selected Document is not in the Prepared Documents. Please change the Document Name", MsgBoxStyle.Information)

End If

End If

End If

UploadFile = True

Else

UploadFile = False

MsgBox("Connection Failed! Please try again", MsgBoxStyle.Information)

End If

Catch objE As Exception

MsgBox("obj err: FTP object error. " & objE.Message, MsgBoxStyle.Information)

UploadFile = False

Finally

objFTP.Close()

objFTP = Nothing

End Try

End Function

 

View other groups in this category.

Click here!
Also on MSN:
Start Chatting | Listen to Music | House & Home | Try Online Dating | Daily Horoscopes

To stop getting this e-mail, or change how often it arrives, go to your E-mail Settings.

Need help? If you've forgotten your password, please go to Passport Member Services.
For other questions or feedback, go to our Contact Us page.

If you do not want to receive future e-mail from this MSN group, or if you received this message by mistake, please click the "Remove" link below. On the pre-addressed e-mail message that opens, simply click "Send". Your e-mail address will be deleted from this group's mailing list.
Remove my e-mail address from dotNET User Group Hyd.

Reply via email to