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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T21:41:06+00:00 2026-06-13T21:41:06+00:00

Is it possible to invoke sftp outbound endpoint, and send a file, through the

  • 0

Is it possible to invoke sftp outbound endpoint, and send a file, through the code?
I have a reference to a File object in java code (in a custom transformer), and I want to invoke sftp outbound endpoint and pass that File reference. Is this doable?
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-06-13T21:41:07+00:00Added an answer on June 13, 2026 at 9:41 pm

    Pass it a FileInputStream, that should work.

    muleContext.getClient().dispatch("sftp://...", new FileInputStream(file), null);
    

    If not, you’ll have to pass it a byte[].

    Note that dispatch is asynchronous: the call will return immediately while the SFTP communication occurs. if you want to wait until it’s done, use send with a time-out as last parameter.

    Since you have several SFTP connectors configured, you’ll have to specify the connector name in the URL. Supposing you want to dispatch using SFTP_Upload_Connector, you’ll have to use:

    muleContext.getClient().dispatch("sftp://...?connector=SFTP_Upload_Connector", new FileInputStream(file), null);
    

    If you want to set a particular destination file name, pass it as a property named filename in the properties map, for example using:

    muleContext.getClient().dispatch("sftp://...?connector=SFTP_Upload_Connector", new FileInputStream(file), Collections.singletonMap("filename", "somen_ame"));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

is it possible to invoke .jnlp file from java code? Example: Process p =
Possible Duplicate: How can I lock a file using java (if possible) I have
Is it possible to invoke Java EE web services from iPhone? and how?
Is it possible to invoke an application on reception of an sms. I have
Possible Duplicate: C++ invoke explicit template constructor First imagine I have a class Data
Is it possible to invoke ripple emulator from a custom made web app (ASP.NET
is it possible to invoke facebook share from php code? I mean, when any
is it possible to invoke a delegate method of a class by code? In
Is it possible to invoke the book mark action sheet in mobile safari through
Is it possible to invoke Java RMI asynchronously? I'd like my RMI call to

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.