I have developed a mobile app with Ionic v1 . In one of the modules or sections that my app has, I show user data, such as name , email , telephone and also the IMAGE . The image is saved on my server, my WebService receives the file from the mobile app and saves it.
When I select all users to display on the mobile app the JSON
one I submitted has the format of the object plus the base64 encoded image . I tried with 10 or 15 users without any problem but today we went to the QA phase, with around 100 users and there my server collapsed. I think I understand that it is for so many characters that my function returns since the image comes in base64 code .
My webservice is created in WCF framework 4.0 with C# , in the web config I have the following:
<bindings>
<webHttpBinding>
<binding name="LargeWsHttp" maxBufferSize="2147483647"
maxBufferPoolSize="2147483647"
maxReceivedMessageSize="2147483647"
transferMode="Streamed"
sendTimeout="00:05:00">
<readerQuotas maxDepth="2147483647"
maxStringContentLength="2147483647"
maxArrayLength="2147483647"
maxBytesPerRead="2147483647"
maxNameTableCharCount="2147483647"/>
<security mode="None" />
</binding>
</webHttpBinding>
</bindings>
For the matter of sending and receiving data. But obviously you must exceed this limit. My query is: What is the best option for the treatment of images?
I thought :
Send the URL of the image and display it in the application, the problem is that the app can also work offline.
Download the image from the mobile app and save it to the app. Here I don't know if it saves as a file or in the app's local database to save it with the base64 code . This download would be done by obtaining the URL of the file.
Users can increase, it can be 500, 1000, 2000 since it is an application that will be very popular within a community of a specific sport.
I receive help and constructive criticism, in order to improve my product.
Anything you need, code, explanations of the flows etc, I will provide.
You can use this plugin , the operation is more than anything:
It checks if it finds the image in the cache, if it doesn't have it, it downloads it and displays it. The next time the app is opened it will show everything from cache without the need to download again.
Facility:
This plugin depends on ngStorage , ngCordova , angular-svg-round-progress . Therefore, they have to be loaded into the
index.html
.It also has to be added to the dependencies in the angular module :
To see more customization and different ways of using it with other tags , you can visit the repo in the link above.