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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T01:00:29+00:00 2026-05-28T01:00:29+00:00

I am retrieving a file from our FTP server which is then put into

  • 0

I am retrieving a file from our FTP server which is then put into memory and passed to the client via HTTPS. I have everything working flawlessly. However, if I turn on SSL, I get the following error:

WebException: The remote server returned an error: (500) Syntax error,
command unrecognized.]
System.Net.FtpWebRequest.SyncRequestCallback(Object obj) +330
System.Net.FtpWebRequest.RequestCallback(Object obj) +23
System.Net.CommandStream.InvokeRequestCallback(Object obj) +17
System.Net.CommandStream.Abort(Exception e) +168
System.Net.FtpWebRequest.FinishRequestStage(RequestStage stage) +454
System.Net.FtpWebRequest.GetResponse() +1398

Here is my code:

FtpWebRequest ftp = (FtpWebRequest)WebRequest.Create(@"ftp://" + serverName + ":21/" + fileName);
            ftp.Credentials = new NetworkCredential(userName, password);
            ftp.UseBinary = true;
            ftp.EnableSsl = true;
            ftp.Method = WebRequestMethods.Ftp.DownloadFile;
            FtpWebResponse response = null;
            response = (FtpWebResponse)ftp.GetResponse();

If I set http://ftp.EnableSsl to false or just comment it out, it works fine. Any ideas as to what I am doing wrong. Keep in mind, I am on a Windows XP Professional box using the IIS built in FTP Server. I am debugging from IIS and I am running under https://localhost/projectNameHere/default.aspx.

  • 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-05-28T01:00:29+00:00Added an answer on May 28, 2026 at 1:00 am

    If you trust the server, you can override Validation process to your need.

    ServicePointManager.ServerCertificateValidationCallback = new RemoteCertificateValidationCallback(ValidateServerCertificate);
    
    public static bool ValidateServerCertificate(object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors)
    {
        System.Diagnostics.Debug.WriteLine(certificate);             
        return true;         
    } 
    

    Your connection and data will still be secure. You should not use this code if you don’t trust the source, since the source can be impersonator.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm retrieving a file from a database server and allowing the user to download
This is user.php: include(databse.php);//retrieving successfully first name and lastname from databse file into user.php
I have a binary file in big-endian format from which I am retrieving 2-bit
I used following code for downloading XML file from ftp to android phone memory
I am writing a script that is retrieving information from file places.sqlite (history) and
I have developed a VB.Net code for retrieving data from excel file .I load
We have a flash retrieving information from an XML file. Right now we are
I retrieving data from a csv/txt file using oledb driver ConnString = Provider=Microsoft.Jet.OleDb.4.0; Data
I am trying to read an XML-file from another server. However the the company
I am currently reading an XML file from a PHP script (as below) which

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.