12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- //
- // ZYLUploadFile.h
- // NetworkLayerBuild
- //
- // Created by 翟玉磊 on 2017/8/31.
- // Copyright © 2017年 翟玉磊. All rights reserved.
- //
- #import <Foundation/Foundation.h>
- //上传类型
- typedef enum : NSUInteger {
- ZYLUploadFileTypePng,
- ZYLUploadFileTypeJpg,
- ZYLUploadFileTypeMp3
- } ZYLUploadFileType;
- @interface ZYLUploadFile : NSObject
- + (instancetype)pngImageWithFileData:(NSData *)data imageName:(NSString *)name;/**< 默认以data的md5值做uploadKey */
- + (instancetype)jpgImageWithFileData:(NSData *)data imageName:(NSString *)name;/**< 默认以data的md5值做uploadKey */
- + (instancetype)mp3AudioWithFileData:(NSData *)data audioName:(NSString *)name;/**< 默认以data的md5值做uploadKey */
- + (instancetype)pngImageWithFileData:(NSData *)data imageName:(NSString *)name uploadKey:(NSString *)key;
- + (instancetype)jpgImageWithFileData:(NSData *)data imageName:(NSString *)name uploadKey:(NSString *)key;
- + (instancetype)mp3AudioWithFileData:(NSData *)data audioName:(NSString *)name uploadKey:(NSString *)key;
- /**
- 利用参数初始化上传类
- @param data NSData数据
- @param name 文件名
- @param type 上传类型
- @param key 上传uploadKey
- @return 返回上传类
- */
- - (instancetype)initWithFileData:(NSData *)data fileName:(NSString *)name fileType:(ZYLUploadFileType)type uploadKey:(NSString *)key;
- /**
- 获取上传参数
- */
- - (NSData *)fileData;
- - (NSString *)fileName;
- - (NSString *)fileType;
- - (NSString *)uploadKey;
- - (NSString *)md5String;
- @end
|