use a timestamp instead

Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
main
sigonasr2 3 years ago
parent 4e695d3947
commit 01446dd035
  1. 5
      src/sig/ArcadeScreenshotHandler.java

@ -40,8 +40,9 @@ public class ArcadeScreenshotHandler {
System.out.println(e.getActionCommand()); System.out.println(e.getActionCommand());
try { try {
BufferedImage img = CaptureScreen(); BufferedImage img = CaptureScreen();
ImageIO.write(img,"png",new File("..","screenshot.png")); String filename="screenshot"+System.currentTimeMillis()+".png";
POSTRequest postRes = new POSTRequest("http://"+args[0]+"/uploadform.html",Path.of("..","screenshot.png")); ImageIO.write(img,"png",new File("..",filename));
POSTRequest postRes = new POSTRequest("http://"+args[0]+"/uploadform.html",Path.of("..",filename));
System.out.println(((HttpResponse<String>)postRes.run()).body()); System.out.println(((HttpResponse<String>)postRes.run()).body());
} catch (FailedResponseException | IOException e1) { } catch (FailedResponseException | IOException e1) {
e1.printStackTrace(); e1.printStackTrace();

Loading…
Cancel
Save