samedi 6 avril 2019

How can I download image asynchronously from s3 on my web application?

I am making web application. but I am facing a little problem. when I was making asynchronous download image feature from s3 to iphone mobile app. I was able to download image asynchronously and even track how many byte I downloaded. There was no problem. but I want to make same service with web. I can get my data asynchronously with axios or xmlhttprequest as json from server. That means receiving text data is working very well. My json data include image download urls list in S3. In order to show images from S3 to my web service. I just set to src attribute of img tag. it's working very well. but I need to show my buttons and some features when I download image completely. Now my buttons showed up before image downloaded completely. that means I need to track when image downloaded 100%.

I searched and read some article about this. if I encode my images to text with base64. The article said I could track it with axios or jquery, whatever sort of ajax library. I tried it. it's working well. but I have big problem. I have images over 10000. Do I have to convert all images before launching service on web? Do I have to have two type of images(raw, base64 encoding text) for web and mobile app? or My server convert image to deliver every reqeust. Is that only one solution? I think that's not very efficient. I need to pay double for s3.

please someone help me out. if you have a better solution. please share for me.

Thank you in advance.




Aucun commentaire:

Enregistrer un commentaire