hidden ftp upload

Do you need something made? then ask in here.
Forum rules
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
6 posts Page 1 of 1
Contributors
User avatar
Martin
Supreme VIP
Supreme VIP
Posts: 369
Joined: Sat Aug 01, 2009 12:26 pm

hidden ftp upload
Martin
hi how do i make a hidden ftp upload? liek i dont want the progressbarr dialog to show when u upload somethign to your ftp.
Image
User avatar
bisnes_niko
Serious Programmer
Serious Programmer
Posts: 409
Joined: Tue Aug 24, 2010 1:21 pm

Re: hidden ftp upload
bisnes_niko
Hello, try using WebClient.
Code: Select all
Dim wcl As New Net.WebClient
        wcl.Credentials = New Net.NetworkCredential("user", "pass")
        wcl.UploadFile("address", "fileloc") ' Then you use multi-threading to stop it from freezing your application or just use:         wcl.UploadFileAsync(New Uri("address"), "fileloc")

User avatar
dan2130
VIP - Donator
VIP - Donator
Posts: 104
Joined: Sat Sep 26, 2009 3:39 am

Re: hidden ftp upload
dan2130
If you have a web hosting in the same server you can simply create a page with a php script for upload of files and you just upload your file at this address and it will show nothing
admin@adosrv.net
Owner of ado-srv.net softwares network.
User avatar
CodenStuff
Site Admin
Site Admin
Posts: 4392
Joined: Tue Aug 04, 2009 1:47 am

Re: hidden ftp upload
CodenStuff
Or this:
Code: Select all
My.Computer.Network.UploadFile("c:\File.txt", "http://www.someserver.com/upload.aspx", "username", "password", False, 500)
Or this:
Code: Select all
Dim Upload As System.Net.FtpWebRequest = DirectCast(System.Net.WebRequest.Create("ftp://ftp.YOURSITE.com/SaveUploadedFileToThisName.txt"), System.Net.FtpWebRequest)
            Upload.Credentials = New System.Net.NetworkCredential("USERNAME", "PASSWORD")
            Upload.Method = System.Net.WebRequestMethods.Ftp.UploadFile
            Dim Enc As New System.Text.UTF8Encoding()
            Dim File() As Byte = Enc.GetBytes("C:\FileToUpload.txt")
            Dim UploadStream As System.IO.Stream = Upload.GetRequestStream()
            UploadStream.Write(File, 0, File.Length)
            UploadStream.Close()
            UploadStream.Dispose()
Welcome to CodenStuff.com Learn Code, Love Code. Thank you for being a member of the community.
User avatar
Martin
Supreme VIP
Supreme VIP
Posts: 369
Joined: Sat Aug 01, 2009 12:26 pm

Re: hidden ftp upload
Martin
macHard wrote:
Hello, try using WebClient.
Code: Select all
Dim wcl As New Net.WebClient
        wcl.Credentials = New Net.NetworkCredential("user", "pass")
        wcl.UploadFile("address", "fileloc") ' Then you use multi-threading to stop it from freezing your application or just use:         wcl.UploadFileAsync(New Uri("address"), "fileloc")

What do you meane with my program will freeze? Also could you explain more how it could make it not to freeze dident really get it.
Image
User avatar
bisnes_niko
Serious Programmer
Serious Programmer
Posts: 409
Joined: Tue Aug 24, 2010 1:21 pm

Re: hidden ftp upload
bisnes_niko
Martin wrote:
macHard wrote:
Hello, try using WebClient.
Code: Select all
Dim wcl As New Net.WebClient
        wcl.Credentials = New Net.NetworkCredential("user", "pass")
        wcl.UploadFile("address", "fileloc") ' Then you use multi-threading to stop it from freezing your application or just use:         wcl.UploadFileAsync(New Uri("address"), "fileloc")

What do you meane with my program will freeze? Also could you explain more how it could make it not to freeze dident really get it.
Let's say this code works through a button on the form. You click it, then this program will just wait till the function is completed, in this case file upload. That prevents you to do anything on the form until file upload is complete.
6 posts Page 1 of 1
Return to “Tutorial Requests”