From 01446dd035f98282a9d4fbf5610ae9c18b848d5c Mon Sep 17 00:00:00 2001 From: sigonasr2 Date: Sat, 21 May 2022 13:44:00 -0500 Subject: [PATCH] use a timestamp instead Co-authored-by: sigonasr2 --- src/sig/ArcadeScreenshotHandler.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/sig/ArcadeScreenshotHandler.java b/src/sig/ArcadeScreenshotHandler.java index 4dbbd00..46c704e 100644 --- a/src/sig/ArcadeScreenshotHandler.java +++ b/src/sig/ArcadeScreenshotHandler.java @@ -40,8 +40,9 @@ public class ArcadeScreenshotHandler { System.out.println(e.getActionCommand()); try { BufferedImage img = CaptureScreen(); - ImageIO.write(img,"png",new File("..","screenshot.png")); - POSTRequest postRes = new POSTRequest("http://"+args[0]+"/uploadform.html",Path.of("..","screenshot.png")); + String filename="screenshot"+System.currentTimeMillis()+".png"; + ImageIO.write(img,"png",new File("..",filename)); + POSTRequest postRes = new POSTRequest("http://"+args[0]+"/uploadform.html",Path.of("..",filename)); System.out.println(((HttpResponse)postRes.run()).body()); } catch (FailedResponseException | IOException e1) { e1.printStackTrace();