>
FTP upload in vb.net
Welcome, Guest

by Nitin on Tuesday, 12 October 2010
FTP upload in vb.net


Use Below method 

 

Public Sub uploadFileUsingFTP(ByVal CompleteFTPPath As String, ByVal CompleteLocalPath AsString, Optional ByVal UName As String = "",  Optional ByVal PWD As String = "")

 

'Create a FTP Request Object and Specfiy a Complete Path

 Dim reqObj As FtpWebRequest = WebRequest.Create(CompleteFTPPath)

'Make sure you have concatinated filename in 'CompleteFTPPath

 

'Call A FileUpload Method of FTP Request Object

 reqObj.Method = WebRequestMethods.Ftp.UploadFile

 

'If you want to access Resourse Protected You need to give User Name      and PWD

 reqObj.Credentials = New NetworkCredential(UName, PWD)

 

'FileStream object read file from Local Drive

 Dim streamObj As FileStream = File.OpenRead(CompleteLocalPath)

 

'Store File in Buffer

 Dim buffer(streamObj.Length) As Byte

 

'Read File from Buffer

 streamObj.Read(buffer, 0, buffer.Length)

 

'Close FileStream Object Set its Value to nothing

 streamObj.Close()

 streamObj = Nothing

 

'Upload File to ftp://localHost/ set its object to nothing

 reqObj.GetRequestStream().Write(buffer, 0, buffer.Length)

 reqObj = Nothing

 

End Sub

'Cheers

'Nitin Jain



Blogger Image
My Blog Title

Product Engineering, software engineering company, Product Development, Product Migration, Product Re-engineering, Product Maintenance, Product Testing Commercial Application Development, Business Software development, commercial software for startups, Application Support and Maintenance, software testing Product Maintenance, Outsource product maintenance, product support and maintenance Product Migration, Product Re-engineering, product re-engineering services Product Research, Product Engineering, UI Prototyping Services Software Testing Services, Quality Assurance services, professional software testers, Load Testing, Functional Testing, Cross Platform, Browser Testing, Test Automation, Testing Tools, software quality analysis Functional Testing Services, software quality analysis, Software Testing Services, Application Testing Services, Functional Testing Types Automated Testing, Automated Testing Services, automation testing, test script development, Automation Test Tools, outsource automation testing Load Testing, Performance Testing Services, Load Testing Tools Offshore Software Development, Outsource software services, offshore outsourcing services, offshore software development services, IT outsourcing services, software quality assurance services, Offshore IT services, Custom Application Development Services, Offshore Product Engineering Benefits of IT Outsourcing, Offshore Software Development companies, offshore software development firms Outsource planning, IT outsourcing, IT development services, offshore IT companies, offshore software development Offshore Software Development, Outsource software services, offshore outsourcing services, offshore software development services, IT outsourcing services, software quality assurance services, Offshore IT services, Custom Application Development Services, Offshore Product Engineering Offshore Software Development, Outsource software services, offshore outsourcing services, offshore software development services, IT outsourcing services, software quality assurance services, Offshore IT services, Custom Application Development Services, Offshore Product Engineering