Best practice for uploading a file to cdn when developing a mobile application?

I am making a mobile application. I used the Azure mobile service as a backend service to create a mobile application. In the mobile application, I need to upload images to the azure cloud storage. I can do two ways.

  • Downloading a file from a client application

  • uploding by sending a byte array or base64 line of the file to the server and the server will support this file for them

I think the first method is good, because it is directly going to upload the file instead of going to the server and clicking on the azure storage again.

I don't know which approach is good. Any help is determined

+4
source share
3 answers

As David noted, the question is a little broad and not related to CDN, but within the framework of Azure Mobile Services, I would recommend option No. 1, since it offers several advantages, including (but not limited to):

  • The minimum load on your mobile service, potentially eliminating the need to scale the service to keep up with file management.
  • The ability to use storage APIs designed to control a client’s management blob, and you don’t need to implement and maintain similar APIs as part of your service (including support for resuming upload / download and other useful features for mobile applications)
  • () , Azure Storage, , .

...

- , API , SAS . , SDK .

, !

+3

, ​​ Filestack, , CDN.

Azure :

filepicker.pickAndStore(
  {
    mimetype:"image/*",
    multiple: true
  },
  {
    location:"azure"
  },
  function(Blobs){
    console.log(JSON.stringify(Blobs));
  },
  function(error){
//  console.log(JSON.stringify(error)); - print errors to console
  },
  function(progress){
    console.log(JSON.stringify(progress));
  }
);

URL- CDN, . , , CDN , Filestack Fastly, , .

0

I use Cloudinary - these are images for creating websites or mobile applications. It really easily uploads images to a CDN.

-2
source

Source: https://habr.com/ru/post/1626632/


All Articles