图片上传

This commit is contained in:
huangdeliang
2021-02-01 15:55:08 +08:00
parent 3062b00b22
commit baf8f5973c
2 changed files with 8 additions and 7 deletions

View File

@ -57,7 +57,7 @@ public class WxTokenUtils {
*/
public static WxFileUploadResult uploadImage(String filePath, String fileName, String accessToken) throws Exception {
String[] cmds = {"curl", uploadMaterialUrl.replaceAll("ACCESS_TOKEN", accessToken), "-F"
, "media='@" + filePath + ";filename=" + fileName + "'"};//必须分开写,不能有空格
, "media='@" + filePath + "'"};//必须分开写,不能有空格
ProcessBuilder process = new ProcessBuilder(cmds);
Process p = process.start();