Results 1 to 9 of 9

Thread: FTP access help !! vb6

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2008
    Posts
    4

    FTP access help !! vb6

    hi guys,
    i am trying to open the ftp server that i have and to create a new file in it
    so
    the code i am working with is " open ("c://t.text") for appened as #1 .... bla bla bla close #1 "
    so is there a way to open an ftp client and to use the same command in it , and where should i put the userName and password of my ftp ?
    i dont want the program users to know what is the username and the password or the ftp link !!!
    is that possible !? plz help

    tanks in advanced
    Tamby Qunash

  2. #2
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: FTP access help !! vb6

    Welcome to the forums.

    Wouldn't it just be easier to modify your text file and once done, upload it to the FTP site?

  3. #3

    Thread Starter
    New Member
    Join Date
    Mar 2008
    Posts
    4

    Re: FTP access help !! vb6

    thank you, well i am trying to do a S.W to write on the FTP text file !
    and to get data from there !

  4. #4
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: FTP access help !! vb6

    Is the text file being written to while it is on the FTP server?

  5. #5

    Thread Starter
    New Member
    Join Date
    Mar 2008
    Posts
    4

    Re: FTP access help !! vb6

    no, i want to create that text file and to write in it
    as you know, i used in local pc this code ---
    vb Code:
    1. open ("C:/t/data.txt") for append as #1
    2. print #1,data
    3. close #1
    ---
    it will create the file and write in it, is there a way to open the FTP and do the same !! and how should i tell the program about the username and pass ?
    Last edited by tambyq; Mar 10th, 2008 at 11:44 AM.

  6. #6
    PowerPoster
    Join Date
    Jan 2008
    Posts
    11,074

    Re: FTP access help !! vb6

    is there a way to open the FTP and do the same !!

    Not in the same way that you are doing it on your PC. You do not open a file on a FTP server, append to it, then close it. You create your file on your PC and then send the completed file to the FTP server using FTP protocol. There is plenty of code samples around here that show you how to do a FTP download but I have not seen one that shows you how to do a FTP upload but I'm sure there is such code here. Unless you can find some example of how to upload via FTP you may have to either write your own FTP client application or use a third party FTP client like CuteFTP, for example.

  7. #7

  8. #8

    Thread Starter
    New Member
    Join Date
    Mar 2008
    Posts
    4

    Re: FTP access help !! vb6

    thank you so much for this help

  9. #9
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: FTP access help !! vb6

    the ftp apis are quite easy to use
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width