Quantcast
Channel: Ionic Forum - Latest topics
Viewing all articles
Browse latest Browse all 71531

Upload array of photos to multer service

$
0
0

@krauserman wrote:

Hello, i have big problem with a module of my app, i need to upload an array of files from my app like this way:

By the side of ionic i use this:

My provider method that get the local system url

resolveLocalUri(filePath:any){
    return this.file.resolveLocalFilesystemUrl(filePath)
}

By the sife of my page i convert each photo to file

for(var k = 0 ; k < this.photos.length; k++){
      var filePhoto = (<FileEntry>await this.nativeProvider.resolveLocalUri(this.photos[k]))
      filePhoto.file(file=>{
        this.files.push(file)
      })
    }

My uploader service

const formData = new FormData();
    let headers = new HttpHeaders();
    headers = headers.append('Authorization',token)
    //const reader = new FileReader();
    //reader.onloadend = ()=>{
      for(let i = 0; i < files.length; i++){
        formData.append(fileKey, files[i], files[i]['name'])
      }
    //}
    return this.http.post(this.url+params,formData,{headers:headers})

But nothing :frowning:

Some help please

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 71531

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>