How to transfer files via FTP under .net?

Discussion in 'ASP .Net' started by Lacka, Jan 13, 2005.

  1. Lacka

    Lacka Guest

    Hi,

    How can I transfer files via FTP under asp.net? Don't found any info...

    thanks,
    Lacka
     
    Lacka, Jan 13, 2005
    #1
    1. Advertising

  2. Ken Cox [Microsoft MVP], Jan 13, 2005
    #2
    1. Advertising

  3. Lacka

    Lacka Guest

    Thanks!

    > Lots of examples here:
     
    Lacka, Jan 13, 2005
    #3
  4. Hi Lacka,

    Be warned: FTP is a notoriously unreliable protocol, and the examples you
    will see are only the bare bones of what you will need to create a robust
    FTP client. You will have to handle almost every conceivable type of FTP
    transfer error that there is, and there are quite a few.

    --
    HTH,

    Kevin Spencer
    Microsoft MVP
    ..Net Developer
    Neither a follower nor a lender be.

    "Lacka" <> wrote in message
    news:eIg7VGY%...
    > Thanks!
    >
    >> Lots of examples here:

    >
    >
     
    Kevin Spencer, Jan 13, 2005
    #4
  5. Lacka

    Lacka Guest

    Hi Kevin,

    I don't want to write an FTP client - I just want to upload a file to
    somewhere. Like sending a mail - uploading a file. When unsuccessful, I need
    to log the error (just "upload unsuccessful"), and don't want to do further
    tasks. Therefore looking for a simple FTP uploader solution, that can use
    under asp.net - say from a webservice.

    > Be warned: FTP is a notoriously unreliable protocol, and the examples you
    > will see are only the bare bones of what you will need to create a robust
    > FTP client. You will have to handle almost every conceivable type of FTP
    > transfer error that there is, and there are quite a few.
     
    Lacka, Jan 13, 2005
    #5
  6. > I don't want to write an FTP client - I just want to upload a file to
    > somewhere. Like sending a mail - uploading a file. When unsuccessful, I
    > need
    > to log the error (just "upload unsuccessful"), and don't want to do
    > further
    > tasks. Therefore looking for a simple FTP uploader solution, that can use
    > under asp.net - say from a webservice.


    Uploading a file somewher via FTP, means you need to write an FTP client.
    There are only 2 entities in an FTP session: Client and server. Which one
    are you planning to write? Hint: The answer is "FTP client."

    Now, if you write an FTP client that connects to an FTP server, and attempts
    to upload a file, pay attention to my warnings! There is no such thing as "a
    simple FTP uploader (read 'client') solution." The basic protocol is about
    as simple as they get. Handling dropped packets and other FTP issues is not.

    --
    HTH,

    Kevin Spencer
    Microsoft MVP
    ..Net Developer
    Neither a follower nor a lender be.

    "Lacka" <> wrote in message
    news:%23Zmr$UY%...
    > Hi Kevin,
    >
    > I don't want to write an FTP client - I just want to upload a file to
    > somewhere. Like sending a mail - uploading a file. When unsuccessful, I
    > need
    > to log the error (just "upload unsuccessful"), and don't want to do
    > further
    > tasks. Therefore looking for a simple FTP uploader solution, that can use
    > under asp.net - say from a webservice.
    >
    >> Be warned: FTP is a notoriously unreliable protocol, and the examples you
    >> will see are only the bare bones of what you will need to create a robust
    >> FTP client. You will have to handle almost every conceivable type of FTP
    >> transfer error that there is, and there are quite a few.

    >
    >
     
    Kevin Spencer, Jan 13, 2005
    #6
  7. Lacka

    Lacka Guest

    Ok, understand.

    I have downloaded some components from gotdotnet (thanks for Ken), but I
    don't know what to do then? Can you or anybody explain, where to copy the
    files of the downloaded component, and how to use it in an aspx file? I
    never installed .net components yet, so for me don't say nothing the
    filename *.vb, *.sln, *.suo, *.vbproj, etc... Some exaples are on the
    gotdotnet site, but no words about installation. I use WebMatrix to create
    the aspx files.

    Here are the list of files downloaded:

    Component #1
    ---------------
    AssemblyInfo.vb
    clsFTP.vb
    FTP.sln
    FTP.suo
    FTP.vbproj
    FTP.vbproj.user
    bin\FTP.dll
    FTP.pdb


    Component #2
    ---------------
    AssemblyInfo.cs
    FtpConnection.cs
    FtpException.cs
    FtpStream.cs
    FtpSupport.csproj
    FtpSupport.csproj.user
    FtpSupport.sln
    FtpSupport.suo
    NativeMethods.cs

    thanks
     
    Lacka, Jan 13, 2005
    #7
  8. Hi Lacka,

    WebMatrix, eh? Well, I'm out. You're going to have to create a scripted
    class using Web Matrix, and I have never used it, or scripted classes. I'm a
    VS.Net guy. Love them DLLs.

    Another alternative would be to shell out a few bucks for a commercial .Net
    FTP client. There are several at least out there in Google-Land.

    --
    HTH,

    Kevin Spencer
    Microsoft MVP
    ..Net Developer
    Neither a follower nor a lender be.

    "Lacka" <> wrote in message
    news:u4c1$EZ%...
    > Ok, understand.
    >
    > I have downloaded some components from gotdotnet (thanks for Ken), but I
    > don't know what to do then? Can you or anybody explain, where to copy the
    > files of the downloaded component, and how to use it in an aspx file? I
    > never installed .net components yet, so for me don't say nothing the
    > filename *.vb, *.sln, *.suo, *.vbproj, etc... Some exaples are on the
    > gotdotnet site, but no words about installation. I use WebMatrix to create
    > the aspx files.
    >
    > Here are the list of files downloaded:
    >
    > Component #1
    > ---------------
    > AssemblyInfo.vb
    > clsFTP.vb
    > FTP.sln
    > FTP.suo
    > FTP.vbproj
    > FTP.vbproj.user
    > bin\FTP.dll
    > FTP.pdb
    >
    >
    > Component #2
    > ---------------
    > AssemblyInfo.cs
    > FtpConnection.cs
    > FtpException.cs
    > FtpStream.cs
    > FtpSupport.csproj
    > FtpSupport.csproj.user
    > FtpSupport.sln
    > FtpSupport.suo
    > NativeMethods.cs
    >
    > thanks
    >
    >
     
    Kevin Spencer, Jan 13, 2005
    #8
  9. I feel that our FTP Library is the best designed on the market. It
    even supports Secure FTP.

    You'll be sending/receiving files with only one line of code.

    http://www.xceedsoft.com/products/FtpNet

    And for the same price as other commercial FTP libraries, at Xceed you
    get the entire Data Manipulation suite (includes the bestselling Xceed
    Zip for .NET, for example).

    On Thu, 13 Jan 2005 12:35:33 -0500, "Kevin Spencer"
    <> wrote:

    >Hi Lacka,
    >
    >WebMatrix, eh? Well, I'm out. You're going to have to create a scripted
    >class using Web Matrix, and I have never used it, or scripted classes. I'm a
    >VS.Net guy. Love them DLLs.
    >
    >Another alternative would be to shell out a few bucks for a commercial .Net
    >FTP client. There are several at least out there in Google-Land.


    --
    Alex Leblanc
    Xceed Software Inc.
    http://www.xceedsoft.com

    Check out our advanced .NET grid and SmartUI controls

    Email: (remove the first 'x')
     
    AlexL [Xceed], Jan 17, 2005
    #9
  10. Your products are priced nicely too (and no, I never have worked for XCeed).

    --
    HTH,

    Kevin Spencer
    Microsoft MVP
    ..Net Developer
    Neither a follower nor a lender be.

    "AlexL [Xceed]" <> wrote in message
    news:...
    >I feel that our FTP Library is the best designed on the market. It
    > even supports Secure FTP.
    >
    > You'll be sending/receiving files with only one line of code.
    >
    > http://www.xceedsoft.com/products/FtpNet
    >
    > And for the same price as other commercial FTP libraries, at Xceed you
    > get the entire Data Manipulation suite (includes the bestselling Xceed
    > Zip for .NET, for example).
    >
    > On Thu, 13 Jan 2005 12:35:33 -0500, "Kevin Spencer"
    > <> wrote:
    >
    >>Hi Lacka,
    >>
    >>WebMatrix, eh? Well, I'm out. You're going to have to create a scripted
    >>class using Web Matrix, and I have never used it, or scripted classes. I'm
    >>a
    >>VS.Net guy. Love them DLLs.
    >>
    >>Another alternative would be to shell out a few bucks for a commercial
    >>.Net
    >>FTP client. There are several at least out there in Google-Land.

    >
    > --
    > Alex Leblanc
    > Xceed Software Inc.
    > http://www.xceedsoft.com
    >
    > Check out our advanced .NET grid and SmartUI controls
    >
    > Email: (remove the first 'x')
     
    Kevin Spencer, Jan 17, 2005
    #10
  11. The only comment I have about that is that they're
    probably "priced nicely" for the US market.

    For many 2nd and 3rd world markets,
    their price is prohibitive, and will encourage pirating.

    It has been my long-standing viewpoint that software producers
    in more-developed countries ( like the US, UK, Australia, Spain,
    etc. ) should have lower pricing scales for less-developed markets.

    Not scaling down prices so that developers in less-developed
    countries which can't compete economically, because their
    countris have less-devoped economies, only leads to more
    pirating of software useful for developers.

    I don't see a reason to peg high prices on software
    which is bought by less-developed countries.

    At the, comparatively, high prices which are normal for
    more-developed countries, the market is close to nil
    in less-developed countries.

    Making developer software accessible at lower prices in
    less-developed countries doesn't equate to a revenue loss
    for the companies who make developer software.

    It only serves as a stimulus for more revenue when
    the economies of those countries upscales.

    Setting lower prices for software shipped to less-developed
    countries will actually increase revenue for software developers.




    Juan T. Llibre
    ASP.NET MVP
    ===========
    "Kevin Spencer" <> wrote in message
    news:uGTnVCL$...
    > Your products are priced nicely too (and no, I never have worked for
    > XCeed).
    >
    > --
    > HTH,
    >
    > Kevin Spencer
    > Microsoft MVP
    > .Net Developer
    > Neither a follower nor a lender be.
    >
    > "AlexL [Xceed]" <> wrote in message
    > news:...
    >>I feel that our FTP Library is the best designed on the market. It
    >> even supports Secure FTP.
    >>
    >> You'll be sending/receiving files with only one line of code.
    >>
    >> http://www.xceedsoft.com/products/FtpNet
    >>
    >> And for the same price as other commercial FTP libraries, at Xceed you
    >> get the entire Data Manipulation suite (includes the bestselling Xceed
    >> Zip for .NET, for example).
    >>
    >> On Thu, 13 Jan 2005 12:35:33 -0500, "Kevin Spencer"
    >> <> wrote:
    >>
    >>>Hi Lacka,
    >>>
    >>>WebMatrix, eh? Well, I'm out. You're going to have to create a scripted
    >>>class using Web Matrix, and I have never used it, or scripted classes.
    >>>I'm a
    >>>VS.Net guy. Love them DLLs.
    >>>
    >>>Another alternative would be to shell out a few bucks for a commercial
    >>>.Net
    >>>FTP client. There are several at least out there in Google-Land.

    >>
    >> --
    >> Alex Leblanc
    >> Xceed Software Inc.
    >> http://www.xceedsoft.com
    >>
    >> Check out our advanced .NET grid and SmartUI controls
    >>
    >> Email: (remove the first 'x')

    >
    >
     
    Juan T. Llibre, Jan 17, 2005
    #11
  12. Interesting. I suppose it is conceivable to show different pricing for
    products (as well as different currency) depending on the country of
    origin of the visitor to a web site. I'd wager it is being done
    already. It would have to be done carefully, though, so as not to
    complicate things for sales staff. Example... When asked about pricing
    by telephone, one would have to make sure to know the country of
    origin first.

    On Mon, 17 Jan 2005 12:41:44 -0400, "Juan T. Llibre"
    <> wrote:

    >The only comment I have about that is that they're
    >probably "priced nicely" for the US market.
    >
    >For many 2nd and 3rd world markets,
    >their price is prohibitive, and will encourage pirating.
    >
    >It has been my long-standing viewpoint that software producers
    >in more-developed countries ( like the US, UK, Australia, Spain,
    >etc. ) should have lower pricing scales for less-developed markets.
    >
    >Not scaling down prices so that developers in less-developed
    >countries which can't compete economically, because their
    >countris have less-devoped economies, only leads to more
    >pirating of software useful for developers.
    >
    >I don't see a reason to peg high prices on software
    >which is bought by less-developed countries.
    >
    >At the, comparatively, high prices which are normal for
    >more-developed countries, the market is close to nil
    >in less-developed countries.
    >
    >Making developer software accessible at lower prices in
    >less-developed countries doesn't equate to a revenue loss
    >for the companies who make developer software.
    >
    >It only serves as a stimulus for more revenue when
    >the economies of those countries upscales.
    >
    >Setting lower prices for software shipped to less-developed
    >countries will actually increase revenue for software developers.
    >
    >
    >
    >
    >Juan T. Llibre
    >ASP.NET MVP
    >===========
    >"Kevin Spencer" <> wrote in message
    >news:uGTnVCL$...
    >> Your products are priced nicely too (and no, I never have worked for
    >> XCeed).
    >>
    >> --
    >> HTH,
    >>
    >> Kevin Spencer
    >> Microsoft MVP
    >> .Net Developer
    >> Neither a follower nor a lender be.
    >>
    >> "AlexL [Xceed]" <> wrote in message
    >> news:...
    >>>I feel that our FTP Library is the best designed on the market. It
    >>> even supports Secure FTP.
    >>>
    >>> You'll be sending/receiving files with only one line of code.
    >>>
    >>> http://www.xceedsoft.com/products/FtpNet
    >>>
    >>> And for the same price as other commercial FTP libraries, at Xceed you
    >>> get the entire Data Manipulation suite (includes the bestselling Xceed
    >>> Zip for .NET, for example).
    >>>
    >>> On Thu, 13 Jan 2005 12:35:33 -0500, "Kevin Spencer"
    >>> <> wrote:
    >>>
    >>>>Hi Lacka,
    >>>>
    >>>>WebMatrix, eh? Well, I'm out. You're going to have to create a scripted
    >>>>class using Web Matrix, and I have never used it, or scripted classes.
    >>>>I'm a
    >>>>VS.Net guy. Love them DLLs.
    >>>>
    >>>>Another alternative would be to shell out a few bucks for a commercial
    >>>>.Net
    >>>>FTP client. There are several at least out there in Google-Land.
    >>>
    >>> --
    >>> Alex Leblanc
    >>> Xceed Software Inc.
    >>> http://www.xceedsoft.com
    >>>
    >>> Check out our advanced .NET grid and SmartUI controls
    >>>
    >>> Email: (remove the first 'x')

    >>
    >>

    >


    --
    Alex Leblanc
    Xceed Software Inc.
    http://www.xceedsoft.com

    Check out our advanced .NET grid and SmartUI controls

    Email: (remove the first 'x')
     
    AlexL [Xceed], Jan 18, 2005
    #12
  13. Lacka

    rpress Guest

    I too am looking for an FTP solution for asp.net, I do not wish to
    purchase a third party solution. I cannot use HTTPfilkeTransfer as the
    files may be 2 Gigs or more in size, would consume too much memory.

    The sample page is down, are those examples anywhere else? Does anyone
    know of an alternative to FTP for uploading very large files from an
    asp.net page?

    Thanks

    Bob


    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
     
    rpress, Jan 26, 2005
    #13
  14. > The sample page is down, are those examples anywhere else? Does anyone
    > know of an alternative to FTP for uploading very large files from an
    > asp.net page?


    HTTP? It's much more reliable, and if you plan on writing your own FTP
    client, you're in for a lot of trouble. FTP is very unreliable, and prone to
    errors. You have to handle them all.

    --
    HTH,

    Kevin Spencer
    Microsoft MVP
    ..Net Developer
    Neither a follower nor a lender be.

    "rpress" <> wrote in message
    news:%...
    >
    > I too am looking for an FTP solution for asp.net, I do not wish to
    > purchase a third party solution. I cannot use HTTPfilkeTransfer as the
    > files may be 2 Gigs or more in size, would consume too much memory.
    >
    > The sample page is down, are those examples anywhere else? Does anyone
    > know of an alternative to FTP for uploading very large files from an
    > asp.net page?
    >
    > Thanks
    >
    > Bob
    >
    >
    > *** Sent via Developersdex http://www.developersdex.com ***
    > Don't just participate in USENET...get rewarded for it!
     
    Kevin Spencer, Jan 26, 2005
    #14
  15. Lacka

    rpress Guest

    HTTP would be fine if not for the file size limitations - Microsoft
    says:Theoretically, the maximum file upload size is fairly large.
    However, because of ASP.NET health monitoring, you cannot upload very
    large files in ASP.NET. The ASP.NET worker process has a virtual address
    space of 2 gigabytes (GB). However, the ASP.NET worker process only uses
    a little more than 1 GB because of health monitoring and memory
    fragmentation.

    During the upload process, ASP.NET loads the whole file in memory before
    the user can save the file to the disk. Therefore, the process may
    recycle because of the memoryLimit attribute of the processModel tag in
    the Machine.config file. The memoryLimit attribute specifies the
    percentage of physical memory that the ASP.NET worker process can
    exhaust before the process is automatically recycled. Recycling prevents
    memory leaks from causing ASP.NET to crash or to stop responding.

    Additionally, other factors play a role in the maximum file size that
    can be uploaded. These factors include available memory, available hard
    disk space, processor speed, and current network traffic. With regular
    traffic of files being uploaded, Microsoft recommends that you use a
    maximum file size in the range of 10 to 20 megabytes (MB). If you rarely
    upload files, the maximum file size may be 100 MB.


    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
     
    rpress, Jan 31, 2005
    #15
  16. Hmm... did you say Web Service?? Why not send the file as MTOM attachment -
    using a byte array? If the client that consumes the web service is a smart
    client / winform application it would be a quick and fit solution.

    "Lacka" wrote:

    > Hi Kevin,
    >
    > I don't want to write an FTP client - I just want to upload a file to
    > somewhere. Like sending a mail - uploading a file. When unsuccessful, I need
    > to log the error (just "upload unsuccessful"), and don't want to do further
    > tasks. Therefore looking for a simple FTP uploader solution, that can use
    > under asp.net - say from a webservice.
    >
    > > Be warned: FTP is a notoriously unreliable protocol, and the examples you
    > > will see are only the bare bones of what you will need to create a robust
    > > FTP client. You will have to handle almost every conceivable type of FTP
    > > transfer error that there is, and there are quite a few.

    >
    >
    >
     
    =?Utf-8?B?cmFqaXZwb3BhdA==?=, Mar 24, 2006
    #16
  17. broken link

    "Ken Cox [Microsoft MVP]" wrote:

    > Hi,
    >
    > Lots of examples here:
    >
    > http://www.gotdotnet.com/community/usersamples/Default.aspx?query=ftp
    >
    > Ken
    > Microsoft MVP [ASP.NET]
    >
    > "Lacka" <> wrote in message
    > news:ur%23R6ZX%...
    > > Hi,
    > >
    > > How can I transfer files via FTP under asp.net? Don't found any info...
    > >
    > > thanks,
    > > Lacka
    > >
    > >

    >
    >
     
    =?Utf-8?B?c3BhcnR5MTAyMg==?=, Mar 31, 2006
    #17
    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.
Similar Threads
  1. Manoj K.S
    Replies:
    1
    Views:
    704
    127.0.0.1
    Dec 2, 2003
  2. Replies:
    3
    Views:
    5,662
  3. Vin Raja

    FTP : Time problem (net/ftp)

    Vin Raja, Jun 7, 2007, in forum: Ruby
    Replies:
    0
    Views:
    103
    Vin Raja
    Jun 7, 2007
  4. Ari Brown

    Net::FTP and ftp.dir()

    Ari Brown, Jul 16, 2007, in forum: Ruby
    Replies:
    0
    Views:
    88
    Ari Brown
    Jul 16, 2007
  5. D. Buck
    Replies:
    2
    Views:
    494
    D. Buck
    Jun 29, 2004
Loading...

Share This Page