Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8943005
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T11:40:08+00:00 2026-06-15T11:40:08+00:00

So I have my FTP program working great with static file names for the

  • 0

So I have my FTP program working great with static file names for the download and upload portions. Now management has asked that the program be able to rename the downloaded file and append the date to the file in MMdd format and then up load that file to the ftp server.

I think I have the code correct for the renaming part of the process here

//Generate name for download file
string filePath = @"c:\";
string fileName = Path.Combine(filePath,string.Format("PMP{MMdd}.txt", DateTime.Now));

My question is how do I pass that variable over to the upload portion of the program.

This is how I have the class defined

public void upload(string remoteFile, string localFile)

And this is how I’m passing the static file names over to the class

/* Upload a File */
UploadftpClient.upload("testup.txt", @"c:\testup.txt");

I built the program using the code found here http://www.codeproject.com/Tips/443588/Simple-Csharp-FTP-Class

Programming isn’t my strong suit and I’m stumped as to how to accomplish what I need to do here.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T11:40:10+00:00Added an answer on June 15, 2026 at 11:40 am

    Is this what you’re looking for?

    UploadftpClient.upload(Path.GetFileName(localfile), localfile);
    

    EDIT: The following line should replace the one you are using

    string fileName = Path.Combine(filePath, "PMP" + DateTime.Now.ToString("MMdd") + ".txt");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have written a stand alone Program to upload file to FTP Server. Code
I have to upload a file to an FTP server. The filename contains special
I have developed a download/upload manager script. When I upload a file via POST
I have to create a program that would upload business data to the FTP
I have a program that has Classes GUI Upload and a buffer between the
I have a ftp client that allows users to upload files. I want determine
I have response stream from a ftp web request that returns binary file. I
Hi have an ip address that has an FTP already setup on it (port
I have a vb.net 2.0 program, that has a batch/queue routine to execute tasks
I have some code that downloads a file from the internet located here: http://www.amsat.org/amsat/ftp/keps/current/nasa.all

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.