he's made a image uploader/video uploader on his site.
he's made a image uploader/video uploader on his site.
Like Pic8?
Like Pic8?
well pic8 is a proxy meaning it'll keep the image alive across multiple hosts, his is a host I am bugging to come add his as a host to pic8 he hasn't responded to my pings yet.
well pic8 is a proxy meaning it'll keep the image alive across multiple hosts, his is a host I am bugging @picman to come add his as a host to pic8 he hasn't responded to my pings yet.
Cool, thanks, I think I have it.
Cool, thanks, I think I have it.
In case he does come by I'm going to post some code from my syncbox project that should give him some idea of how to do it.
var config = require('/home/k/.syncboxrc');
var request = require('request');
var jar = request.jar();
var signedin = false;
function login(cb) {
if(signedin) { return cb(); }
var formData = {username:config.username,password:config.password};
request.post({url:'https://js.lifelist.pw',jar,formData},()=>{
signedin = true;
cb();
});
}
function uploadfile(filepath,contentType,cb) {
//This will be using /ppkey/fset
//Therefor we need to log in to the service before we mix the post bodies of a login and a file
var filename = filepath.split('/').pop();
login(()=>{
var formData = {
file:{
value: fs.createReadStream(filepath),
options: {filename,contentType}
}
}
request.post({url:`https://js.lifelist.pw/ppkey/fset/upload/${filename}`,jar,formData},cb);
});
}
In case he does come by I'm going to post some code from my syncbox project that should give him some idea of how to do it.
```
var config = require('/home/k/.syncboxrc');
var request = require('request');
var jar = request.jar();
var signedin = false;
function login(cb) {
if(signedin) { return cb(); }
var formData = {username:config.username,password:config.password};
request.post({url:'https://js.lifelist.pw',jar,formData},()=>{
signedin = true;
cb();
});
}
function uploadfile(filepath,contentType,cb) {
//This will be using /ppkey/fset
//Therefor we need to log in to the service before we mix the post bodies of a login and a file
var filename = filepath.split('/').pop();
login(()=>{
var formData = {
file:{
value: fs.createReadStream(filepath),
options: {filename,contentType}
}
}
request.post({url:`https://js.lifelist.pw/ppkey/fset/upload/${filename}`,jar,formData},cb);
});
}
```
(post is archived)