zxsaed / fastdfs

Springboot2.0.5 + fastdfs 整合

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

FastDFS 使用说明

依赖软件

  • FastDFS 源代码(libfastcommon 依赖包) 注意版本
  • Nginx 源代码 (fastdfs-nginx-module)注意版本

所有依赖软件整包

安裝参考

环境说明

  • 基于Spring boot 2.0.5
  • 基于单机 FastDFS 系统

FAQ

    下载地址添加attname参数
    &attname=文件名.后缀
    
    nginx配置
    location /group1/M00/ {
        root /data2/fastdfs/data;
        if ($arg_attname ~ "^(.+)") {
            #设置下载
            add_header Content-Type application/x-download;
            #设置文件名
            add_header Content-Disposition "attachment;filename=$arg_attname";
        }
        ngx_fastdfs_module;
    }
    eg:** http://192.168.243.87:8888/group1/M00/00/00/wKjzV1u69RyAP42WAAACdWyPsX8129.txt?&attname=tannongchun.txt **
           返回的文件ID由group、存储目录、两级子目录、fileid、文件后缀名(由客户端指定,主要用于区分文件类型)拼接而成。
  • 2.文件管理界面

  • 3.Ubuntu 默认是没有gcc ,gcc++ 编译器

    • 解决方案如下: 切记->使用apt 安装源采用Ubuntu 官方地址。使用阿里源有些依赖包下载不了。
  • 4.单机部署fastdfs ,主要ip 地址不能是127.0.0.1或者localhost 这种,而应该是 192.168..

  • 5.storage.conf 里面 http.server_port=80 端口 需要和nginx 配置的端口一致。

  • 6.注意防火墙。

About

Springboot2.0.5 + fastdfs 整合


Languages

Language:Java 100.0%