GithubHelp home page GithubHelp logo

formstream's People

Contributors

dead-horse avatar fengmk2 avatar fjc0k avatar mrspeiser avatar semantic-release-bot avatar shaozj avatar xingrz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

formstream's Issues

创建的maltipart有问题

当批量上传时,这里有很多无关的信息被创建了,导致请求400
单个上传没有这个问题
image
image

formstream的package.json文件依赖的"mime": "^1.3.4",

安装依赖会安装2.0版本,因为node-mime代码方法名改了
Version 2 is a breaking change from 1.x as the semver implies. Specifically:

lookup() renamed to getType()
extension() renamed to getExtension()
charset() and load() methods have been removed
If you prefer the legacy version of this module please npm install mime@^1. Version 1 docs may be found here.
这样会引发报错
nodejs.TypeError: mime.lookup is not a function
请更新下指定版本

path.replace is not a function

代码:

const formstream = require('formstream')
const fs = require('fs')
const path = require('path')
const filepath = path.join(__dirname, '1.jpg')
const file = fs.createReadStream(filepath)

const stream = formstream()
stream.file('uri', file)
stream.field('hello', 'world')
console.log(stream)

报错:

  var ext = path.replace(/^.*[\.\/\\]/, '').toLowerCase();
                 ^

TypeError: path.replace is not a function
 at Mime.lookup (/project/node_modules/mime/mime.js:70:18)
    at FormStream.file (/project/node_modules/formstream/lib/formstream.js:113:23)
    at Object.<anonymous> (/project/form-data.js:35:8)
    at Module._compile (internal/modules/cjs/loader.js:776:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    at Function.Module.runMain (internal/modules/cjs/loader.js:829:12)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.