Sonorc
Sonorc
IImmich
Created by Sonorc on 12/27/2024 in #help-desk-support
API - Upload a picture - uploadAsset
OK, I'll try to implement it with CLI. I just came across upload asset via the search engine. Thanks
13 replies
IImmich
Created by Sonorc on 12/27/2024 in #help-desk-support
API - Upload a picture - uploadAsset
Okay, because my idea was to save photos that I take with my camera on a Raspberry Pi, for example, and then sync them with me as soon as the Raspberry Pi has internet.
13 replies
IImmich
Created by Sonorc on 12/27/2024 in #help-desk-support
API - Upload a picture - uploadAsset
13 replies
IImmich
Created by Sonorc on 12/27/2024 in #help-desk-support
API - Upload a picture - uploadAsset
how else should I do it? I just took it from the docs from immich.
13 replies
IImmich
Created by DeMASKe on 8/3/2023 in #help-desk-support
API - Upload a picture
Hello, the current uploadAsset doesn't work? I want to upload an image via node js and I always get an error message.
const axios = require('axios');
const FormData = require('form-data');
const fs = require('fs');
let data = new FormData();
data.append('assetData', fs.createReadStream('H:\\Git\\bilder\\Neu\\backend\\uploads\\1351335.png'));

data.append('deviceAssetId', '');
data.append('deviceId', '');
data.append('duration', '');


let config = {
method: 'post',
maxBodyLength: Infinity,
url: 'http://127.0.0.1:8980/api/assets?key=z8vuYdyn3loVPP8DhBx6S0Zh2aKiU3T8CzVoT7jDZIs',
headers: {
'Content-Type': 'multipart/form-data',
'Accept': 'application/json',
...data.getHeaders()
},
data : data
};


axios.request(config)
.then((response) => {
console.log(JSON.stringify(response.data));
})
.catch((error) => {
console.log(error);
});
const axios = require('axios');
const FormData = require('form-data');
const fs = require('fs');
let data = new FormData();
data.append('assetData', fs.createReadStream('H:\\Git\\bilder\\Neu\\backend\\uploads\\1351335.png'));

data.append('deviceAssetId', '');
data.append('deviceId', '');
data.append('duration', '');


let config = {
method: 'post',
maxBodyLength: Infinity,
url: 'http://127.0.0.1:8980/api/assets?key=z8vuYdyn3loVPP8DhBx6S0Zh2aKiU3T8CzVoT7jDZIs',
headers: {
'Content-Type': 'multipart/form-data',
'Accept': 'application/json',
...data.getHeaders()
},
data : data
};


axios.request(config)
.then((response) => {
console.log(JSON.stringify(response.data));
})
.catch((error) => {
console.log(error);
});
data: { message: 'Invalid share key', error: 'Unauthorized', statusCode: 401, correlationId: '0ikytt67' }
12 replies