diff options
Diffstat (limited to 'juick-server')
-rw-r--r-- | juick-server/src/main/java/com/juick/server/util/HttpUtils.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/juick-server/src/main/java/com/juick/server/util/HttpUtils.java b/juick-server/src/main/java/com/juick/server/util/HttpUtils.java index e54bef874..c305093c1 100644 --- a/juick-server/src/main/java/com/juick/server/util/HttpUtils.java +++ b/juick-server/src/main/java/com/juick/server/util/HttpUtils.java @@ -61,7 +61,7 @@ public class HttpUtils { } return StringUtils.EMPTY; } - public static String downloadImage(URL url) throws Exception { + public static String downloadImage(URL url, String tmpDir) throws Exception { String attachmentFName = null; Exception ex = null; @@ -82,7 +82,7 @@ public class HttpUtils { } attachmentFName = UUID.randomUUID().toString() + "." + attachmentType; - fos = new FileOutputStream("/var/www/juick.com/i/tmp/" + attachmentFName); + fos = new FileOutputStream(Paths.get(tmpDir, attachmentFName).toString()); byte[] buffer = new byte[10240]; int len; while ((len = is.read(buffer)) > 0) { |