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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T19:11:55+00:00 2026-06-16T19:11:55+00:00

First, sorry for my bad english. The problem is I can not upload a

  • 0

First, sorry for my bad english.

The problem is I can not upload a file (.xls) file on a local FTP server.

This is the Exception :

[org.apache.camel.component.file.GenericFileOperationFailedException - Error writing file GAS_EAV_EMV.xls]

This is my route :

<route id="sendFtp">
    <from uri="direct:sendFtp"/>
    <setHeader headerName="CamelFileName">
        <simple>GAS_EAV_EMV.xls</simple>
    </setHeader>
    <process ref="egssisFtpProcessor"/>
    <to uri="ftp://foo@127.0.0.1:21/?password=pwd"/>
</route>

Here my Processor to attach the file :

public class EgssisFtpProcessor implements Processor {

    @Override
    public void process(Exchange exchange) throws Exception {
        String filename = exchange.getIn().getHeader(Exchange.FILE_NAME, String.class);
        exchange.getIn().addAttachment(filename, new DataHandler(new FileDataSource(filename)));
    }
}

The exchange object has the attachment at the end of the processor.

It works with the SMTP protocol but not with FTP.

Any idea ?

Server log :

[14:29:29] - [78] Connecté à 127.0.0.1. Collecte du Nom d'utilisateur.
[14:29:29] - [78] Usager FOO Connecté IP: 127.0.0.1
[14:29:29] - [78] FOO : Répertoire en Cours: C:\tmp\
[14:29:29] - [78] Client 127.0.0.1 Déconnecté (00:00:00 Min)
  • 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-16T19:11:56+00:00Added an answer on June 16, 2026 at 7:11 pm

    Attachements is not used. Instead just set the message body to a java.io.File for the file you want to upload.

    exchange.getIn().setBody(new File(filename));
    

    And since you use XML you may want to do this without any java code. You can use the message translator EIP to convert the message body to a java.io.File with the header as the file name.

    <transform>
        <simple resultType="java.io.File">${header.CamelFileName}</simple>
    </transform>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

First, sorry for my bad english, I'm French. Here the problem : I have
At first sorry my bad English. I want define routing for this url: For
first of all... i'm italian, so i'm sorry for my bad english! so... this
Sorry for my bad English. I have a log file from a Web server
first sorry for my bad English, I'm having a small problem with .eq() jQuety
First,sorry to my bad english. I don't understand why my page not refresh when
First of all, sorry for my bad English... I have a problem with one
first of all, sorry for my bad english (if so), as I am not
First sorry for my bad English. I have this menubar in PHP. I want
First I'm sorry for my bad english it's not my native language. I'm new

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.