Creating a file in the temporary directory of the mini program.
The SDK facilitates the creation of files natively within the cache directory of the Mini Program, subsequently returning the local path of the file for the host's use.
Sample code:
TMAFileManager *fm = [[TMFMiniAppSDKManager sharedInstance] getFileManagerWithAppID:appInfo.appId];
NSString *tmpPath = [fm createMediaTmpPathWithFileName:@"a.pdf" type:TMATmpPathTypeFile needTimestamp:YES];
Converting an absolute path into a wxfile path.
The SDK enables the conversion of file paths, originally created in the Mini Program's cache directory, into file paths used by the Mini Program itself, thereby facilitating internal use within the Mini Program.
Sample code:
TMAFileManager *fm = [[TMFMiniAppSDKManager sharedInstance] getFileManagerWithAppID:appInfo.appId];
NSString *tmpPath = [fm createMediaTmpPathWithFileName:@"a.pdf" type:TMATmpPathTypeFile needTimestamp:YES];
NSString *wxPath = [fm translateAnyPathToWxfilePath:tmpPath];
Converting a wxfile path into an absolute path.
The SDK enables the conversion of file paths, originally created in the Mini Program's cache directory, into file paths used by the Mini Program itself, thereby facilitating internal use within the Mini Program.
Sample code:
TMAFileManager *fm = [[TMFMiniAppSDKManager sharedInstance] getFileManagerWithAppID:appInfo.appId];
NSString *filePath = [fm translateWxfilePathToAbsolutePath:wxPath];
Was this page helpful?