|
|
|
@ -108,7 +108,12 @@ public class sigServer { |
|
|
|
|
} |
|
|
|
|
} else { |
|
|
|
|
System.out.println(line); |
|
|
|
|
File myFile = new File(new File(sigPlace.OUTDIR,sigPlace.UPLOADSDIR),filename); |
|
|
|
|
File myFile = null; |
|
|
|
|
if (filename.contains(".png")) { |
|
|
|
|
myFile = new File(sigPlace.ARCADEDIR,filename); |
|
|
|
|
} else { |
|
|
|
|
myFile = new File(new File(sigPlace.OUTDIR,sigPlace.UPLOADSDIR),filename); |
|
|
|
|
} |
|
|
|
|
// check if file exist, otherwise create the file before writing
|
|
|
|
|
myFile.mkdirs(); |
|
|
|
|
System.out.println("Dirs added."); |
|
|
|
@ -145,9 +150,9 @@ public class sigServer { |
|
|
|
|
CreateRequest(client,"400","Bad Request",Paths.get(sigPlace.OUTDIR,"testfile.html")); |
|
|
|
|
return; |
|
|
|
|
} else { |
|
|
|
|
System.out.println("Saving upload to "+sigPlace.UPLOADSDIR+" directory."); |
|
|
|
|
System.out.println("Saving upload to "+myFile); |
|
|
|
|
if (filename.contains(".png")) { |
|
|
|
|
ArcadeReader.submitToDatabase(Paths.get(sigPlace.OUTDIR,sigPlace.UPLOADSDIR,filename)); |
|
|
|
|
ArcadeReader.submitToDatabase(Paths.get(sigPlace.ARCADEDIR,filename)); |
|
|
|
|
System.out.println("Submitted to the database!"); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|