Code Monkey home page Code Monkey logo

oss-async-await's People

Contributors

ihahoo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

oss-async-await's Issues

上传成功之后,如何拿到res里面的图片地址呢?

{ status: 200, headers: { server: 'AliyunOSS', date: 'Wed, 02 May 2018 12:11:45 GMT', 'content-length': '0', connection: 'close', 'x-oss-request-id': '5AE9AB0131333D71A2F57143', etag: '"0D0ACC4A3F0B4DBF51443FB8AE67C037"', 'x-oss-hash-crc64ecma': '9316337773539308387', 'content-md5': 'DQrMSj8LTb9RRD+4rmfANw==', 'x-oss-server-time': '104' }, body: '' }
headers信息完整,但是body确实空的

调用put方法时,一直报错

{ Error: getaddrinfo ENOTFOUND yxf-bucket-01.cn-beijing.aliyuncs.com yxf-bucket-01.cn-beijing.aliyuncs.com:80
at errnoException (dns.js:50:10)
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:92:26)
code: 'ENOTFOUND',
errno: 'ENOTFOUND',
syscall: 'getaddrinfo',
hostname: 'yxf-bucket-01.cn-beijing.aliyuncs.com',
host: 'yxf-bucket-01.cn-beijing.aliyuncs.com',
port: 80 }

这个是为什么呢?
我是这么引用的:
let AliOSS = require('oss-async-await').default;
const oss = new AliOSS({
accessKeyId: ossData.accessKeyId,
accessKeySecret: ossData.accessKeySecret,
region: 'cn-beijing',
bucket: ossData.bucket
});

const filepath = '/Users/marx/Desktop/ydhlMaterialCollect/test.jpg';
try {
await oss.put(filepath, 'testwd.jpg');
} catch (e) {
console.log(e);
}

这个有什么不对呢?

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.