FTP Client using C# csharp

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Kumar

    FTP Client using C# csharp

    Hi,

    I am trying to develop FTP client application using c#.

    Our application functinality should be like this:

    1.our client uploads files,folders to our ftp server for every 20 minutes.

    2.At the end of operation they will put one confirmation file (say Done.txt)
    to conirm their upload operation is completed in that cycle.
    3.My new FTP client application should login to that ftp server for every 5
    minutes and check for

    that confirmation file, if it exists then start downloading
    files,folders,s ub folders they uploaded.
    4.The files are large size files and these are in PDF format.

    5.After downloading all the files this FTP client application should delete
    all those files
    folders in that ftp server and create Delete_done.txt file.

    6.we are doing that confirmation file checks to to avoid any file clashes.
    (while upload/download)


    I developed the windows application using c#.
    I used the FTP client library found in the following URL.



    but I have some problems with my ftp client application.

    when I open the PDF file I downloaded using my windows application it is
    giving error as below.

    There was an error opening this document. The file is damaged and
    could not be repaired .


    I found that problem might be the transfer type.
    like ascii,binary,im age etc.

    The ftp client I used in the above url doesn't implement that "TYPE" ftp
    command.
    I tried to implement as below.

    public void setBinaryMode(B oolean mode)
    {

    if(mode)
    {
    sendCommand(thi s.m_state,"TYPE B");
    }
    else
    {
    sendCommand(thi s.m_state,"TYPE A");
    }
    }

    But still I am getting the same pdf file damage error.

    Do you guys have any idea why it is giving this error.

    You can download that FTP client I used using the following URL



    Please help me.

    Any kind of help is greatly appreciated.

    Thanks
    Kumar





  • Ollie Riches

    #2
    Re: FTP Client using C# csharp

    check out this ftp client it supports different types

    edtFTPnet/Free is an open-source .NET FTP library (LGPL) with active and passive modes, binary and ASCII transfers, and resumable transfers.



    --
    HTH

    Ollie Riches


    Disclaimer: Opinions expressed in this forum are my own, and not
    representative of my employer.
    I do not answer questions on behalf of my employer. I'm just a programmer
    helping programmers.

    "Kumar" <Kumar@discussi ons.microsoft.c om> wrote in message
    news:2D9951F8-B7EC-43E2-9D20-79419F195318@mi crosoft.com...[color=blue]
    > Hi,
    >
    > I am trying to develop FTP client application using c#.
    >
    > Our application functinality should be like this:
    >
    > 1.our client uploads files,folders to our ftp server for every 20 minutes.
    >
    > 2.At the end of operation they will put one confirmation file (say[/color]
    Done.txt)[color=blue]
    > to conirm their upload operation is completed in that cycle.
    > 3.My new FTP client application should login to that ftp server for every[/color]
    5[color=blue]
    > minutes and check for
    >
    > that confirmation file, if it exists then start downloading
    > files,folders,s ub folders they uploaded.
    > 4.The files are large size files and these are in PDF format.
    >
    > 5.After downloading all the files this FTP client application should[/color]
    delete[color=blue]
    > all those files
    > folders in that ftp server and create Delete_done.txt file.
    >
    > 6.we are doing that confirmation file checks to to avoid any file clashes.
    > (while upload/download)
    >
    >
    > I developed the windows application using c#.
    > I used the FTP client library found in the following URL.
    >
    > http://uk.builder.com/programming/wi...9240439,00.htm
    >
    > but I have some problems with my ftp client application.
    >
    > when I open the PDF file I downloaded using my windows application it is
    > giving error as below.
    >
    > There was an error opening this document. The file is damaged and
    > could not be repaired .
    >
    >
    > I found that problem might be the transfer type.
    > like ascii,binary,im age etc.
    >
    > The ftp client I used in the above url doesn't implement that "TYPE" ftp
    > command.
    > I tried to implement as below.
    >
    > public void setBinaryMode(B oolean mode)
    > {
    >
    > if(mode)
    > {
    > sendCommand(thi s.m_state,"TYPE B");
    > }
    > else
    > {
    > sendCommand(thi s.m_state,"TYPE A");
    > }
    > }
    >
    > But still I am getting the same pdf file damage error.
    >
    > Do you guys have any idea why it is giving this error.
    >
    > You can download that FTP client I used using the following URL
    >
    > http://techrepublic.com.com/5138-6240-5604375.html
    >
    > Please help me.
    >
    > Any kind of help is greatly appreciated.
    >
    > Thanks
    > Kumar
    >
    >
    >
    >
    >[/color]


    Comment

    • Mark Rae

      #3
      Re: FTP Client using C# csharp

      "Kumar" <Kumar@discussi ons.microsoft.c om> wrote in message
      news:2D9951F8-B7EC-43E2-9D20-79419F195318@mi crosoft.com...




      Comment

      Working...