【问题标题】:can I call ftp api from spring boot application to download pdf file我可以从 Spring Boot 应用程序调用 ftp api 来下载 pdf 文件吗
【发布时间】:2021-07-14 09:38:44
【问题描述】:

最近我在做一些与手机账单相关的项目, 我得到了一个 ftp url(如下)。该网址以手机号码为参数。有人告诉我,作为回应,它会返回 pdf 文件。

我从来没有从 Spring Boot 应用程序调用 ftp api。反正下面是ftp url:

ftp://phoneApp:phoneApp@10.60.1.140/{MobileNumber}.pdf

在上面的 url 中,我必须将 MobileNumber 作为用户的输入参数,并在这个 ftp url 内部传递相同的参数。

我可以使用 RestTemplate 调用它吗?如果是的话..如何?真的可以吗?

【问题讨论】:

    标签: spring-boot ftp resttemplate


    【解决方案1】:

    您可以使用 Spring Integration 的FtpRemoteFileTemplate 通过 FTP 协议下载文件。

    还请查看以下包含一些示例代码的帖子:Download a single file via FTP with Spring Integration

    【讨论】:

      猜你喜欢
      • 2022-12-29
      • 1970-01-01
      • 2017-12-13
      • 1970-01-01
      • 1970-01-01
      • 2018-05-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多