Latest 2.2
Homepage https://github.com/Insfgg99x/FGDownloader
License MIT
Platforms ios 6.0, requires ARC
Frameworks Foundation, UIKit
Authors

FGGDownloadManager

断点续传下载文件,文件上传显示进度

Version
License
Platform

FGDownloader

Usage

  • download
    
    /**
  • 断点下载(get)
  • @param urlString 下载的链接
  • @param destinationPath 下载的文件的保存路径
  • @param process 进度的回调,会多次调用
  • @param completion 下载完成的回调
  • @param failure 下载失败的回调
    */
  • (void)downloadUrl:(NSString )urlString
    toPath:(NSString
    )destinationPath
    process:(FGProcessHandle)process
    completion:(FGCompletionHandle)completion
    failure:(FGFailureHandle)failure;

/**

  • 断点下载(post)
  • @param host 下载的链接
  • @param p post参数
  • @param destinationPath 下载的文件的保存路径
  • @param process 进度的回调,会多次调用
  • @param completion 下载完成的回调
  • @param failure 下载失败的回调
    */
  • (void)downloadHost:(NSString )host
    param:(NSString
    )p
    toPath:(NSString *)destinationPath
    process:(FGProcessHandle)process
    completion:(FGCompletionHandle)completion
    failure:(FGFailureHandle)failure;

  • upload
    
    /**
  • 上传
  • @param host 服务器地址
  • @param data 文件二进制数据
  • @param p post请求的参数
  • @param fileName 文件名(如1.jpg)
  • @param name 服务器文件的变量名
  • @param mimeType 文件的mimeType(如image/jpeg)
  • @param process 进度的回调(会多次调用)
  • @param completion 成功的回调
  • @param failure 失败的回调
    */
  • (void)upload:(NSString )host
           parama:(NSDictionary
    )p
    file:(NSData )data
    mimeType:(NSString
    )type
    fileName:(NSString )n1
    name:(NSString
    )n2
    process:(FGProcessHandle)process
    completion:(FGUploadCompletionHandle)completion
    failure:(FGFailureHandle)failure;

    
    ### Install
  • Cocopods
    pod repo update
    pod 'FGGDownloader', '~> 2.2'
    pod install
  • Manual
    下载 FGGDownloader 并引入项目,导入FGHeader.h文件

Latest podspec

{
    "name": "FGDownloader",
    "version": "2.2",
    "summary": "FGDownloader is used for resume from break point downloading.",
    "homepage": "https://github.com/Insfgg99x/FGDownloader",
    "license": "MIT",
    "authors": {
        "CGPointZero": "[email protected]"
    },
    "source": {
        "git": "https://github.com/Insfgg99x/FGDownloader.git",
        "tag": "2.2"
    },
    "frameworks": [
        "Foundation",
        "UIKit"
    ],
    "platforms": {
        "ios": "6.0"
    },
    "source_files": "FGDownloader/*.{h,m}",
    "requires_arc": true
}

Pin It on Pinterest

Share This