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 7780011
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T18:47:38+00:00 2026-06-01T18:47:38+00:00

I want to upload file from one server to another FTP server and following

  • 0

I want to upload file from one server to another FTP server and following is my code to upload file but it is throwing an error as:

The remote server returned an error: (550) File unavailable (e.g., file not found, no access).

This my code:

string CompleteDPath = "ftp URL";
string UName = "UserName";
string PWD = "Password";
WebRequest reqObj = WebRequest.Create(CompleteDPath + FileName);
reqObj.Method = WebRequestMethods.Ftp.UploadFile;
reqObj.Credentials = new NetworkCredential(UName, PWD);
FileStream streamObj = System.IO.File.OpenRead(Server.MapPath(FileName));
byte[] buffer = new byte[streamObj.Length + 1];
streamObj.Read(buffer, 0, buffer.Length);
streamObj.Close();
streamObj = null;
reqObj.GetRequestStream().Write(buffer, 0, buffer.Length);
reqObj = null; 

Can you please tell me where i am going wrong?

  • 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-01T18:47:40+00:00Added an answer on June 1, 2026 at 6:47 pm

    Please make sure your ftp path is set as shown below.

    string CompleteDPath = "ftp://www.example.com/wwwroot/videos/";
    
    string FileName = "sample.mp4";
    
    WebRequest reqObj = WebRequest.Create(CompleteDPath + FileName);
    

    The following script work great with me for uploading files and videos to another servier via ftp.

    FtpWebRequest ftpClient = (FtpWebRequest)FtpWebRequest.Create(ftpurl + "" + username + "_" + filename);
    ftpClient.Credentials = new System.Net.NetworkCredential(ftpusername, ftppassword);
    ftpClient.Method = System.Net.WebRequestMethods.Ftp.UploadFile;
    ftpClient.UseBinary = true;
    ftpClient.KeepAlive = true;
    System.IO.FileInfo fi = new System.IO.FileInfo(fileurl);
    ftpClient.ContentLength = fi.Length;
    byte[] buffer = new byte[4097];
    int bytes = 0;
    int total_bytes = (int)fi.Length;
    System.IO.FileStream fs = fi.OpenRead();
    System.IO.Stream rs = ftpClient.GetRequestStream();
    while (total_bytes > 0)
    {
       bytes = fs.Read(buffer, 0, buffer.Length);
       rs.Write(buffer, 0, bytes);
       total_bytes = total_bytes - bytes;
    }
    //fs.Flush();
    fs.Close();
    rs.Close();
    FtpWebResponse uploadResponse = (FtpWebResponse)ftpClient.GetResponse();
    value = uploadResponse.StatusDescription;
    uploadResponse.Close();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have one audio file captured from my iphone. I want to upload this
In my application I want to upload file from SD card to my server.
I want to upload a file to a ftp server programmatically (C++). If the
i want to upload the sound file (.ogg) in server. But it should write
I want to go to select a file from sdcard and upload it to
In Flex i want to upload a particular file to server form local system.how
I want to reset a file upload field when the user selects another option.
I've written a bit of code to upload a file to a server. When
All I want to do is move a MySQL database from one server to
I want to upload files from a client location to a server. At present,

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.