Skip to content

图片上传/裁剪组件使用方法(包括文件上传的说明) #48

Description

@FF-Mercurial

请先安装ImageMagick
ubuntu下sudo apt-get install imagemagick
其他详见src/imageCropper/README.md

另外我添加了处理文件上传的中间件
上传的文件会先临时存放在upload/tmp文件夹
在controller中可以访问到req.files
类似req.body, 按filedname访问
每个file object包含的主要字段参考下面的链接
https://github.com/expressjs/multer#multer-file-object
可以使用这些信息对临时文件做必要的操作
比如上传封面
将图片mv到cover文件夹(mv 临时路径 重命名之后的存放路径)
并将路径写入数据库即可

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions