1 Star 2 Fork 1

ht / springboot-file-online-preview

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
README2.md 1.07 KB
一键复制 编辑 原始数据 按行查看 历史
ht 提交于 2023-11-27 10:48 . http://127.0.0.1:8012/prefileview?fileUrl=

使用说明

1、jackson版本冲突问题,引入以下包

    <dependency>
        <groupId>com.fasterxml.jackson.core</groupId>
        <artifactId>jackson-databind</artifactId>
        <version>2.12.3</version>
    </dependency>
    <dependency>
        <groupId>com.fasterxml.jackson.core</groupId>
        <artifactId>jackson-core</artifactId>
        <version>2.12.3</version>
    </dependency>
    <dependency>
        <groupId>com.fasterxml.jackson.core</groupId>
        <artifactId>jackson-annotations</artifactId>
        <version>2.12.3</version>
    </dependency>

2、直接访问地址(http://127.0.0.1:8012/prefileview?fileUrl=)+文件地址,如 http://127.0.0.1:8012/prefileview?fileUrl=http://5b0988e595225.cdn.sohucs.com/images/20180620/b82e95db61bd4a658f25a6c8e3142b7f.jpeg

特别注意: 1、因为是get请求,文件地址不能过长,否则会被截断 2、返回结果不是一个地址字符串,而是一个二次打开的页面(目前没有办法直接返回一个字符串地址)

马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/huangtao_2021/springboot-file-online-preview.git
git@gitee.com:huangtao_2021/springboot-file-online-preview.git
huangtao_2021
springboot-file-online-preview
springboot-file-online-preview
master

搜索帮助

344bd9b3 5694891 D2dac590 5694891