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).

1  
!636
2  
!standard functions
3  
4  
main {
5  
  static String programID;
6  
  static boolean test;
7  
  
8  
  psvm {
9  
    String name = args[0]; // put file name here
10  
    if (args.length > 1 && args[1].equals("test"))
11  
      test = true;
12  
    name = new File(name).getAbsolutePath();
13  
    byte[] imgdata  = loadBinaryFile(name);
14  
    if (imgdata == null)
15  
      System.out.println("File not found: " + name);
16  
    else
17  
      if (test)
18  
        print(binaryUrlencode(imgdata));
19  
      else
20  
        uploadImage("image-uploader " + programID, "Image " + name + " from " + computerID(), imgdata);
21  
  }
22  
}

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: 598 / 647
Referenced in: [show references]