图片上传

This commit is contained in:
huangdeliang 2021-02-01 16:05:23 +08:00
parent efdbd99e3d
commit 9c8d3bffd4

@ -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 + ";filename=" + fileName};//必须分开写不能有空格
ProcessBuilder process = new ProcessBuilder(cmds);
Process p = process.start();