none
Asp.net Web API | Ftp File Upload Sync or Async RRS feed

  • Question

  • Hello Guys,

    I've asp.net web API which upload some specific documents from end users to FTP file location on the server.
    the website is public and will have many concurrent users, so many uploads can be invoked .

    I want to tell user that the upload is success or fails.


    I'm using the following code to upload

                    FtpWebRequest clsRequest = (FtpWebRequest)System.Net.WebRequest.Create(fileName);
                    clsRequest.Credentials = new NetworkCredential(ftpUsername, ftpPassword);
                    clsRequest.Method = Ftp.UploadFile;
                    using (System.IO.Stream clsStream = clsRequest.GetRequestStream())
                    {
                        clsStream.Write(bytes, 0, bytes.Length);
                        clsStream.Close();
                        clsStream.Dispose();
                    }


    the code is running but I'm afraid the performance and stability with concurrent users
    What's the best way from performance ,stability,and server health with concurrent users and with return success / Failure for each user

    Do I need to use Async calls instead and how code should be changed?

    Thanks
    • Moved by CoolDadTx Sunday, October 14, 2018 2:05 AM ASP.NET related
    Saturday, October 13, 2018 9:02 PM

All replies

  • ASP.NET WebAPI can be discussed at the WebAPI forum in ASP.NET forums.

    http://forums.asp.net/

    Saturday, October 13, 2018 11:10 PM