upoad test

This commit is contained in:
Peter Maquiran
2024-01-24 10:08:21 +01:00
parent c86b737409
commit d1277769a0
11 changed files with 233 additions and 15 deletions
@@ -85,7 +85,7 @@ export class NewPublicationPage implements OnInit {
this.filecontent = true;
}
// this.SocketConnectionMCRService.connect()
this.SocketConnectionMCRService.connect()
}
ngOnInit() {
@@ -416,8 +416,6 @@ export class NewPublicationPage implements OnInit {
}
// this.publicationFormMV.setDataToFrom(this.publication)
// this.publicationFormMV.uploadVideosFiles()
this.publication.Files = this.publication.Files.map( e => ({
FileBase64: e.FileBase64,
@@ -871,6 +869,27 @@ export class NewPublicationPage implements OnInit {
this.seletedContent.splice(index, 1)
}
uploadChunk() {
let time = new Date()
this.publication = {
DateIndex: time,
DocumentId: null,
ProcessId: this.folderId,
Title: this.pub.Title,
Message: this.pub.Message,
DatePublication: time,
OriginalFileName: this.capturedImageTitle || 'foto',
Files: this.seletedContent,
}
this.publicationFormMV.setDataToFrom(this.publication)
this.publicationFormMV.uploadVideosFiles()
}
}
// class UploadFileUseCase {
@@ -988,7 +1007,7 @@ class UploadFileUseCase {
const blob = new Blob([chunk]);
const blobFile = new File([blob], "test.mp4", { type: blob.type });
return await this.CMAPIService.FileContent({length, path, index, blobFile})
return await this.CMAPIService.FileContent({length, path: ChucksManager.path, index, blobFile})
}
if(!ChucksManager.hasPath()) {
@@ -998,11 +1017,12 @@ class UploadFileUseCase {
const blob = new Blob([chuck]);
const blobFile = new File([blob], "test.mp4", { type: blob.type });
const uploadRequest = await this.CMAPIService.FileContent({length, path, index: initIndex, blobFile})
const uploadRequest = await this.CMAPIService.FileContent({length, path:ChucksManager.path, index: initIndex, blobFile})
if(uploadRequest.isOk()) {
path = uploadRequest.value.path
path = uploadRequest.value.data
ChucksManager.setPath(path)
ChucksManager.setResponse(initIndex, uploadRequest.value as any)
} else {