is posible upload photo? i try this:
var promise = Client.Session.create(device, cookiePath, 'username', 'pass')
promise.then(function(sessionInstance) {
Client.Upload.photo(sessionInstance, 'test.jpg').then(function (out) {
console.log(out)
})
})
return Upload object, but no upload 馃槩
@jlobos of course its possible :P here is how to do it:
// import Client as Client.V1
var pathOrStream = './path/to/img.jpg';
Client.Session.create(device, cookiePath, 'username', 'pass')
.then(function(session){
return [Client.Upload.photo(session, pathOrStream), session]
})
.spread(function(upload, session) {
return Client.Media.configurePhoto(session, upload.params.uploadId, "you can provide caption or go let it go")
})
.then(function(medium) {
console.log(medium) // -> return Instance of Client.Media
})
should work that way, try it out...
@huttarichard awesome, very thank!
Most helpful comment
@jlobos of course its possible :P here is how to do it:
should work that way, try it out...