Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

22
LINES

< > BotCompany Repo | #1000743 - Upload an image to TinyBrain

JavaX source code [tags: use-pretranspiled] - run with: x30.jar

Libraryless. Click here for Pure Java version (320L/4K/9K).

!636
!standard functions

main {
  static String programID;
  static boolean test;
  
  psvm {
    String name = args[0]; // put file name here
    if (args.length > 1 && args[1].equals("test"))
      test = true;
    name = new File(name).getAbsolutePath();
    byte[] imgdata  = loadBinaryFile(name);
    if (imgdata == null)
      System.out.println("File not found: " + name);
    else
      if (test)
        print(binaryUrlencode(imgdata));
      else
        uploadImage("image-uploader " + programID, "Image " + name + " from " + computerID(), imgdata);
  }
}

Author comment

Began life as a copy of #740

download  show line numbers  debug dex  old transpilations   

Travelled to 15 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, onxytkatvevr, pyentgdyhuwx, pzhvpgtvlbxg, teubizvjbppd, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1000743
Snippet name: Upload an image to TinyBrain
Eternal ID of this version: #1000743/1
Text MD5: 035b3df309e8a805e2ed9521ddc2d7e8
Transpilation MD5: eb6dee83cc4e5ec314d9ddfd37b68691
Author: stefan
Category:
Type: JavaX source code
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2015-08-25 19:22:52
Source code size: 588 bytes / 22 lines
Pitched / IR pitched: No / Yes
Views / Downloads: 447 / 446
Referenced in: [show references]

Formerly at http://tinybrain.de/1000743 & http://1000743.tinybrain.de