图片上传
This commit is contained in:
parent
05ec53e7ec
commit
efdbd99e3d
@ -57,7 +57,7 @@ public class WxTokenUtils {
|
|||||||
*/
|
*/
|
||||||
public static WxFileUploadResult uploadImage(String filePath, String fileName, String accessToken) throws Exception {
|
public static WxFileUploadResult uploadImage(String filePath, String fileName, String accessToken) throws Exception {
|
||||||
String[] cmds = {"curl", uploadMaterialUrl.replaceAll("ACCESS_TOKEN", accessToken), "-F"
|
String[] cmds = {"curl", uploadMaterialUrl.replaceAll("ACCESS_TOKEN", accessToken), "-F"
|
||||||
, "media='@" + filePath + "'"};//必须分开写,不能有空格
|
, "media=@" + filePath + "filename=" + fileName};//必须分开写,不能有空格
|
||||||
|
|
||||||
ProcessBuilder process = new ProcessBuilder(cmds);
|
ProcessBuilder process = new ProcessBuilder(cmds);
|
||||||
Process p = process.start();
|
Process p = process.start();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user