2

I am having an app in which I am using FTPHelper.h and FTPHelper.m files.

I am downloading the images from the dedicated server using FTP.

It works fine in my project but the images downloaded from server are very slow.

I have 50 images of 4.5mb to download and it takes almost 4 to 5 minutes to download.

I have imported two files FTPHelper.h and FTPHelper.m in my project and below is the code I am using.

-(void)getdata
{
    [FTPHelper sharedInstance].delegate = self;
    [FTPHelper sharedInstance].uname = BASE_USERNAME;
    [FTPHelper sharedInstance].pword = BASE_PASSWORD;
    [FTPHelper sharedInstance].urlString = BASE_URL;
   [FTPHelper list:BASE_URL];
    [FTPHelper download:file];
}

Is there any other way I can reduce the time for it?

Thanks...

rmaddy
  • 314,917
  • 42
  • 532
  • 579
Manthan
  • 3,856
  • 1
  • 27
  • 58

2 Answers2

2

Use AsyncImageView for download that Images in background from web..

See Information about that from THIS LINK.

and Get Demo from AsyncImageView Link.

Also see some different code from this link ios-download-and-save-image-inside-app.

Community
  • 1
  • 1
Paras Joshi
  • 20,427
  • 11
  • 57
  • 70
1

Is there a way you can reduce the file size of these images on server? Since its 4 to 5 MB, most likey these are PNG files. Try saving them as JPG with 80% quality and you would reduce significant size. (This would be a lossy compression thought).

If FTP is not mandatory, there are alternates to downloading, Eg: use URL to access the image.(HTTP instead of FTP).

TorukMakto
  • 2,066
  • 2
  • 24
  • 38