FTP Downloading very slow in iPhone

橙三吉。 提交于 2019-12-11 03:44:38

问题


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...


回答1:


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.




回答2:


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).



来源:https://stackoverflow.com/questions/17745058/ftp-downloading-very-slow-in-iphone

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!