10.5 Lab [1 hour 45 minutes]

Overview
Create an application that uses multi-threading to FTP files
Acceptance Criteria
Acceptance criteria
  • The completed implementation satisfies this requirement: Create a new WPF or console application. It should have a way to launch a web request to FTP one or more files.
  • The completed implementation satisfies this requirement: Use the following code to upload a file via FTP. Replace the file paths with actual paths.
  • The completed implementation satisfies this requirement: Have the FTP functionality occur on a separate thread so that the application does not lock up while it is happening.
1.Create an application that uses multi-threading to FTP files [1 hour 15 minutes]

10.5 Lab

Work through the stories in order. Use the acceptance criteria to check each feature, and complete the nested tasks using the specified names, values, and scenarios.

Instructions
A Create a new WPF or console application. It should have a way to launch a web request to FTP one or more files.

Short History of FTP

Short History of FTP
B Set up FTP code.
1 Use the following code to upload a file via FTP. Replace the file paths with actual paths.

How to: Upload files with FTP

How to: Upload files with FTP
// Get the object used to communicate with the server
FtpWebRequest request = (FtpWebRequest)WebRequest.Create("ftp path to a specific file here");
request.EnableSsl = true;
request.Method = WebRequestMethods.Ftp.UploadFile;
request.Credentials = new NetworkCredential(// credentials here //);
// Copy the contents of the file to the request stream
byte[] fileContents = File.ReadAllBytes("local file path here");
request.ContentLength = fileContents.Length;
Stream requestStream = request.GetRequestStream();
requestStream.Write(fileContents, 0, fileContents.Length);
requestStream.Close();
FtpWebResponse response = (FtpWebResponse)request.GetResponse();
Console.WriteLine("Upload file complete, status {0}", response.StatusDescription);
response.Close();
2 FTP the file(s) to your own FTP server. If you do not have access to an FTP server, use the following path:…

FTP the file(s) to your own FTP server. If you do not have access to an FTP server, use the following path: ftp://wauweb5.ntc.edu/coursecontent/IT/10-152-314/FtpThreadingAssignment/.

Use the current course FTP credentials supplied by the instructor.

3 Choose a file, such as an image, or several files to FTP. The file or files should take a noticeable amount of time to transfer.

FileZilla Download

FileZilla Download

Use the Windows file explorer or a FTP client such as FileZilla to access the remote location and confirm the uploaded files exist. This is also useful to create a remote directory or confirm the remote path before running your code.

C Have the FTP functionality occur on a separate thread so that the application does not lock up while it is happening.
D Add some other functionality to the application that can occur at the same time as the FTP, such as a progress bar. You can…

Add some other functionality to the application that can occur at the same time as the FTP, such as a progress bar. You can use the following link as an example.

Multi-threading with the background worker

Multi-threading with the background worker
Zip and submit the zipped file.
2.Zip and submit the zipped file. [5 minutes]
A Zip and submit the zipped file.
Completion review
3.Review the feature acceptance criteria [25 minutes]
A Confirm the required results

Return to each story and verify its acceptance criteria. Preserve the submission format and destination stated in the activity; a reading, setup guide, lab, video demonstration, and oral final may require different evidence.

Create an application that uses multi-threading to FTP files