Blasanka / aws_s3_plugin

This is a plugin created for file upload to AWS S3
Other
10 stars 12 forks source link

uploading_status result in out of box #3

Open TejaDroid opened 4 years ago

TejaDroid commented 4 years ago

Hi, I'm using this plugins for upload file in s3 bucket, its working fine but there few issues that I found in my app with using this plugin, 1), Progress value goes to out of the box means percentage result in more than 100 (iOS only). 2) Initialisation of plugin take lots of time. If any one have solution then please let me know.

TejaDroid commented 4 years ago

Hi, I find out the solution about the accuracy of progress value in iOS build Just change like

uploadRequest.uploadProgress = { (bytesSent, totalBytesSent,
                totalBytesExpectedToSend) -> Void in
                DispatchQueue.main.async(execute: {
                    //               let uploadedPercentage = Float(totalBytesSent) / (Float(bytesSent) + 0.1)
                    let uploadedPercentage = (Float(totalBytesSent) / (Float(totalBytesExpectedToSend)) * 100)
                    print("byte current \(totalBytesSent) byte total \(totalBytesExpectedToSend) percentage \(uploadedPercentage)")
                    print("Uploaded Percentage : \(Int(uploadedPercentage))")
                    self.events?(Int(uploadedPercentage))
                })
            }
CyberGhost007 commented 4 years ago

Where we need to change?

TejaDroid commented 4 years ago

Where we need to change?

You need to change in "/aws_s3/ios/Classes/SwiftAwsS3Plugin.swift" file.

europa-promatics commented 3 years ago

Can you please share your code with me because i m not even getting progress from uploading status @TejaDroid