mirror of
https://github.com/balzack/databag.git
synced 2025-02-12 11:39:17 +00:00
debugging on android
This commit is contained in:
parent
f7d06e1644
commit
33d9b618bd
@ -145,7 +145,12 @@ async function upload(entry, update, complete) {
|
|||||||
try {
|
try {
|
||||||
if (file.type === 'image') {
|
if (file.type === 'image') {
|
||||||
const formData = new FormData();
|
const formData = new FormData();
|
||||||
|
if (file.data.startsWith('file:')) {
|
||||||
|
formData.append("asset", {uri: file.data, name: 'asset', type: 'application/octent-stream'});
|
||||||
|
}
|
||||||
|
else {
|
||||||
formData.append("asset", {uri: 'file://' + file.data, name: 'asset', type: 'application/octent-stream'});
|
formData.append("asset", {uri: 'file://' + file.data, name: 'asset', type: 'application/octent-stream'});
|
||||||
|
}
|
||||||
let transform = encodeURIComponent(JSON.stringify(["ithumb;photo", "ilg;photo"]));
|
let transform = encodeURIComponent(JSON.stringify(["ithumb;photo", "ilg;photo"]));
|
||||||
let asset = await axios.post(`${entry.url}&transforms=${transform}`, formData, {
|
let asset = await axios.post(`${entry.url}&transforms=${transform}`, formData, {
|
||||||
signal: entry.cancel.signal,
|
signal: entry.cancel.signal,
|
||||||
@ -164,7 +169,12 @@ async function upload(entry, update, complete) {
|
|||||||
}
|
}
|
||||||
else if (file.type === 'video') {
|
else if (file.type === 'video') {
|
||||||
const formData = new FormData();
|
const formData = new FormData();
|
||||||
|
if (file.data.startsWith('file:')) {
|
||||||
|
formData.append("asset", {uri: file.data, name: 'asset', type: 'application/octent-stream'});
|
||||||
|
}
|
||||||
|
else {
|
||||||
formData.append("asset", {uri: 'file://' + file.data, name: 'asset', type: 'application/octent-stream'});
|
formData.append("asset", {uri: 'file://' + file.data, name: 'asset', type: 'application/octent-stream'});
|
||||||
|
}
|
||||||
let thumb = 'vthumb;video;' + file.position;
|
let thumb = 'vthumb;video;' + file.position;
|
||||||
let transform = encodeURIComponent(JSON.stringify(["vlq;video", "vhd;video", thumb]));
|
let transform = encodeURIComponent(JSON.stringify(["vlq;video", "vhd;video", thumb]));
|
||||||
let asset = await axios.post(`${entry.url}&transforms=${transform}`, formData, {
|
let asset = await axios.post(`${entry.url}&transforms=${transform}`, formData, {
|
||||||
@ -185,7 +195,12 @@ async function upload(entry, update, complete) {
|
|||||||
}
|
}
|
||||||
else if (file.type === 'audio') {
|
else if (file.type === 'audio') {
|
||||||
const formData = new FormData();
|
const formData = new FormData();
|
||||||
|
if (file.data.startsWith('file:')) {
|
||||||
|
formData.append("asset", {uri: file.data, name: 'asset', type: 'application/octent-stream'});
|
||||||
|
}
|
||||||
|
else {
|
||||||
formData.append("asset", {uri: 'file://' + file.data, name: 'asset', type: 'application/octent-stream'});
|
formData.append("asset", {uri: 'file://' + file.data, name: 'asset', type: 'application/octent-stream'});
|
||||||
|
}
|
||||||
let transform = encodeURIComponent(JSON.stringify(["acopy;audio"]));
|
let transform = encodeURIComponent(JSON.stringify(["acopy;audio"]));
|
||||||
let asset = await axios.post(`${entry.url}&transforms=${transform}`, formData, {
|
let asset = await axios.post(`${entry.url}&transforms=${transform}`, formData, {
|
||||||
signal: entry.cancel.signal,
|
signal: entry.cancel.signal,
|
||||||
|
Loading…
Reference in New Issue
Block a user