telechargement ping pong

This commit is contained in:
2024-12-11 14:14:36 +01:00
parent b78154c582
commit 60ef5065d4
4 changed files with 66 additions and 51 deletions

View File

@ -40,7 +40,7 @@ export default {
data() {
console.log('feur')
let zipUrl = document.getElementById('archiveInfos').getAttribute('dataarchiveurl');
console.log(zipUrl)
console.log(zipUrl);
return {
zipUrl,
sharedFile: null,

View File

@ -167,20 +167,11 @@ export default {
async loadZipContent() {
try {
var baseUrl = OC.generateUrl('/apps/webtransfer/getZipFile');
var postData = {
subUrl: this.zipUrl
};
let fullUrl = baseUrl + '?subUrl=' + this.zipUrl;
let response = await fetch(baseUrl, {
method: 'POST',
headers: {
'Content-Type': 'application/json' // Type de contenu JSON
},
body: JSON.stringify(postData) // Convertir les données en JSON
})
console.log('response: ', await response.json())
const zipData = await response.blob();
let response = await fetch(fullUrl);
let responseJson = await response.json();
const zipData = responseJson.parameters.data;
this.zipName = this.zipUrl.split('/').pop();
const zip = await JSZip.loadAsync(zipData);
this.zipSize = zipData.size;