图片上传

This commit is contained in:
huangdeliang 2021-02-01 16:03:52 +08:00
parent 05ec53e7ec
commit efdbd99e3d

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