How can I write to text file.(ftp)

Discussion in 'ASP .Net' started by Mike John, Jul 18, 2003.

  1. Mike John

    Mike John Guest

    I want to write to text file, the follow text " My Name Is
    mike"

    Now, I have used the following sysntax:
    dim strFilePath as string = "C:\"
    dim strFileName as string = "MyFile.txt"

    fileopen(1,strfilepath & "\" & strfilename,output)
    write(1," My Name Is mike")
    fileclose(1)

    now, assum that the filepath is a folder that I am ftp to
    it. for example : ftp:\\www.mysite.com\myfolder.

    now, how can I open the file to write to in the myfolder
    folder instead of the C Drive.


    Sincerely yours

    Mike John
     
    Mike John, Jul 18, 2003
    #1
    1. Advertising

  2. You will have to set up an FTP client that allows the file to be opened and
    remembers the path to overwrite the file when save is clicked. I would start
    looking at sites like www.planetsourcecode.com or www.sourceforge.com (or
    even www.gotdotnet.com in the new workspaces) for code projects using FTP.
    You will have to use some form of store (whether in memory or on the drive)
    prior to sending via FTP, as FTP works with files. It is not the same
    concept as opening a file and editing on a local drive (well, ultimately it
    is, but there are more layers of crap).

    You will want to catch exceptions on save as the connection may time out.
    You will have to reopen the FTP site for the user and then FTP the file back
    in these instances.

    --
    Gregory A. Beamer
    MVP; MCP: +I, SE, SD, DBA
    Author: ADO.NET and XML: ASP.NET on the Edge

    ****************************************************************************
    ****
    Think Outside the Box!
    ****************************************************************************
    ****
    "Mike John" <> wrote in message
    news:0dd801c34d2f$3d901400$...
    > I want to write to text file, the follow text " My Name Is
    > mike"
    >
    > Now, I have used the following sysntax:
    > dim strFilePath as string = "C:\"
    > dim strFileName as string = "MyFile.txt"
    >
    > fileopen(1,strfilepath & "\" & strfilename,output)
    > write(1," My Name Is mike")
    > fileclose(1)
    >
    > now, assum that the filepath is a folder that I am ftp to
    > it. for example : ftp:\\www.mysite.com\myfolder.
    >
    > now, how can I open the file to write to in the myfolder
    > folder instead of the C Drive.
    >
    >
    > Sincerely yours
    >
    > Mike John
    >
     
    Cowboy \(Gregory A. Beamer\), Jul 18, 2003
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.

Share This Page