Pass the file to pluginMessage

Discussion in 'Plugin Development' started by LIMPIX31, Aug 31, 2021.

  1. Offline

    LIMPIX31

    I need to transfer a file from server to client via pluginMessage.

    For example:
    /download server.properties

    It works with small files, but if the file is larger, as I understand it, 8 megabytes, then the packet is not transferred. I came up with the idea of splitting the file transfer into 1KB packets, but I'm a little confused about the implementation. Can you tell me what to do, preferably with a code. If transferring large packets is terrible, then tell me how to do it differently, but do not suggest using third-party APIs for this (dropbox, etc.)

    P.S. I am passing bytes to a JSONObject, with the key file and encode the byte array to a string and then decrypt on the client.
     
  2. Offline

    timtower Administrator Administrator Moderator

  3. Offline

    LIMPIX31

    I study packets and it became interesting to do this
     
  4. Offline

    timtower Administrator Administrator Moderator

    @LIMPIX31 Considered just starting an FTP server?
    Sounds like you are doing something very complicated for a task that will never get used.
     
  5. Offline

    LIMPIX31

  6. Offline

    davidclue

    @LIMPIX31 So you actually manipulate clients' computers and download a text file to their computer from a plugin already?
     
  7. Offline

    LIMPIX31

    ? What. Since all the same how to transfer a lot of bytes using pluginMessage
     
  8. Offline

    LIMPIX31

  9. Offline

    davidclue

    @LIMPIX31 I don't know how to do it your particular way with packets but what you could do is set up a MySQL database and store any text you want to on the database and then on the clients computer in your plugin create the text file wherever you want it and simply read the file from the database server.
     
  10. Offline

    LIMPIX31

    (and MYSQL)
     
  11. Offline

    davidclue

  12. Offline

    LIMPIX31

    I do not think so
     

Share This Page