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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T16:59:28+00:00 2026-05-24T16:59:28+00:00

I am trying to save a sftp file in C#. I have found this

  • 0

I am trying to save a sftp file in C#. I have found this example on SaveFileDialog but I cannot get it to work on my application (in fact, i get an error whenever I try to use SaveFileDialog saying it doesn’t exist and I cannot resolve the issue)

Is this the right way to save a file? I am not clicking a button, but getting an sftp file from another location, and saving it locally so I can execute some commands on it.

I am using Microsoft Visual Studio 2010 if that helps.

Edit: I think I confused people with the example that I found. Here is how I am getting the files:

   protected void Page_Load(object sender, EventArgs e)
    {
   Sftp sftp = new AmexSFTP.src.Sftp(Config.sSFTPUrl,
                                     Config.sSFTPAccount,
                                     Config.sSFTPPasswd);
   // Connect to SFTP server
   sftp.Connect();

   List<string> InputFiles = sftp.GetFileList("output");

   //Save files in for each loop here...
  ....}

    public Sftp(string sftpHost, string user, string password)
        : base(sftpHost, user, password)
    {
        Init();
    }

    private void Init()
    {
        m_monitor = new MyProgressMonitor(this);
    }

    public List<string> GetFileList(string path)
    {
        List<string> list = new List<string>();
        foreach (Tamir.SharpSsh.jsch.ChannelSftp.LsEntry entry in SftpChannel.ls(path))
        {
            list.Add(entry.getFilename().ToString());
        }
        return list.ToList();
    }

Maybe SaveFileDialog is not correct? It was what I found for all my google results, so I assumed it was.

Thanks!

  • 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-24T16:59:28+00:00Added an answer on May 24, 2026 at 4:59 pm

    I think you are confusing things a bit. Unless I am mistaken the Page_Load() method is part of an ASP.NET WebForms project. If that’s the case then you are mixing technologies: SaveFileDialog is a WinForms control which is normally used for client applications, not a web pages’s code-behind code.

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

Sidebar

Related Questions

i trying to save this string with a file list into a file but
When trying to save an uploaded file, I get this error and are having
I'm trying to save an XML file encoded as UTF-16 with cElementTree. This is
I'm trying to save a PDF file to SQL Server and I already have
I'm trying to save a file at path WindowsFormsApplication1\WindowsFormsApplication1\SaveFile but the following code returning
Trying to save output from this script to a file based on a cell
Im trying to save a simple script in netbeans to htdocs, but i only
I'm trying to save some UserControl-Infos into a List like this: List<UserControlDetails> myList; public
trying to save a step and combine these two queries but not sure how
I was trying to save a PNG file to photos albums folder on the

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.