Last post May 09, 2019 08:36 PM by eyobzeleke
May 06, 2019 02:55 PM|eyobzeleke|LINK
Hi, so I have this C# web application that lets users upload their receipts to a SQL database as a blob and it runs perfectly ok when there is a solid internet connection. They access the application through their iPhones. However, there are instances when
they would need to do uploads in a very limited internet speed which will take forever to upload those files (obviously!). Any recommendations as far as what I should do? Increasing the internet speed isn't an option. Any leads would be awesome!
Is there a way to upload offline and then sync back once internet access is resumed?
May 06, 2019 03:29 PM|PatriceSc|LINK
They take a photograph of their receipts (coming from uncontrolled sources ?) before uploading them ? It is common to use files having a much higher resolution than needed.
My first though would be to see if the file size couldn't be reduced possibly using something such as https://gist.github.com/makevoid/1659616
May 06, 2019 07:43 PM|eyobzeleke|LINK
Hi PatriceSc, thanks for your prompt response! The users use their iPhone cameras to snap a picture and upload it. I am reducing the size significantly (similar to what you attached) in the C# code before saving it in the database. Appreciate more inputs!
May 07, 2019 06:08 AM|samwu|LINK
This is the network problem of the iphone. The website can't control the network. You can let the user re-upload when the network speed is good.
May 07, 2019 01:56 PM|eyobzeleke|LINK
Thanks for the response Sam. Is there a way to upload offline and then sync back once internet access is resumed?
May 07, 2019 02:59 PM|PatriceSc|LINK
What is the current file size ? It is really reduced already to the minimum you can ? Beyond that you can't magically speed up a slow network. If you meant really when being offline it seems hard for files as the client side storage is pretty limited (try
Edit: I remembered also about
https://developer.mozilla.org/en-US/docs/Web/API/NetworkInformation/downlink but never tried and it's not widely supported. Else you could estimate an expected response time and offer to save the image if the detected speed is really to slow ???
My personal preference would be perhaps to see if I couldn't allow users to send them by mail (taking already advantage of the client side mail app) and then having something on the company side to process the dedicated inbox ???
May 07, 2019 05:49 PM|eyobzeleke|LINK
The current file size is under 100kb to the most part. The latest ones I snapped are 86kb and 59kb.
May 08, 2019 09:06 AM|samwu|LINK
If there is no network, it cannot be uploaded offline. Offline operation is actually operating in the cloud(such as Azure) when there is no network, and then accessing when there is a network.
May 09, 2019 03:14 PM|PatriceSc|LINK
If you really have a speed issue with this kind of small files there is likely not much you can do (not sure which kind of performance you have with those "slow speed" networks).
Else storing that in local storage when offline (or on slow speed detection) might work but make sure if it's worth to invest your time in doing that first (depending if #1 is really that slow ???)
If I really had to, I would likely see if I couldn't let users to send them by mail (and basically they are just using the offline/online/background send capabilities of the mail app) and would have a job to process the inbox.
May 09, 2019 08:36 PM|eyobzeleke|LINK
ok thank you! I will try the Mail option.