【问题标题】:.xls & .xlsx Download file crash using apache camel.xls & .xlsx 使用 apache camel 下载文件崩溃
【发布时间】:2013-06-11 13:45:02
【问题描述】:

我需要使用 apache camel 在 ftp 中上传 xls 和 xlsx 文件。
我有简单的代码在 ftp 中上传下载文件,但它适用于 xls &xlsx 文件。
文件在处理过程中崩溃。

我需要做的任何事情都可以帮助我。
谢谢您的答复。

package ftp;

import org.apache.camel.CamelContext;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.impl.DefaultCamelContext;

public class File_download_local_system {

    public static void main(String args[]) throws Exception {
        //final long delay = 60 * 60 *2000L;
        CamelContext context = new DefaultCamelContext();
        context.addRoutes(new RouteBuilder() {
            @Override
            public void configure() {
                 from("file:D:\\uttam\\files?fileName=test.xls&idempotent=true&noop=true").to("ftp://cuboidology8@127.1.2.3:21/src?password=cuboidology8");
            }
        });
        context.start();
        Thread.sleep(1500);
        context.stop();
    }
}

崩溃意味着当我下载并打开文件时,它给了我一个
类似错误:Excel 在文件中发现不可读的内容

【问题讨论】:

    标签: java ftp apache-camel xls xlsx


    【解决方案1】:

    您只能让此应用程序运行 1.5 秒。那不是很长的时间。你说的崩溃是什么意思?您的问题缺少这些细节。

    【讨论】:

      【解决方案2】:

      请提供属性“binary=true”,因为这是您要传输到 FTP 的 Excel 文件。

      【讨论】:

        猜你喜欢
        • 2014-11-15
        • 2021-09-22
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2021-04-25
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多