How to host files and update it?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By ak14112004

I want to create a menu where multiple files(mostly pdf) are shown and user can download them. I want to update those files, and add new when required without user having to download my app again. How can I do that?

:bust_in_silhouette: Reply From: godot_dev_

I assume the files to be downloaded are on a remote server?

To remove the necessity of downloading your app everytime a file changes, your app will need to be data driven. I imagine you will need some form of netcode:

  • A server that is awaiting client connections, reads it’s a directory in its file system that is shared between your app’s users, and then responds with a list of files names and other attributes such as file size
  • A client that pings the server to request the list of files and can request which file to download from the server. The server would response by reading the appropriate file’s bytes, serializing them, and then send the bytes back to the client. The client would then have to create a file and write the bytes to the file.

Your user interface would need to dynamically be populated at run-time to list file names and files sizes, knowing that the number of files could change. This way, both the client and server’s code won’t need to change, since the design is data-driven and the only thing changing is the files hosted on the server.

You may want to consider the cybersecurity of your app as well

:bust_in_silhouette: Reply From: Jack Pitterson

cool really! thanks for info