ID:1896529
Jul 15 2015, 2:57 am
|
|
Is there any way for me to let admins download any Savefile located at a specific folder on the host's machine, to their own computer?
|
Unfortunately that's not how file() works. You'll want ftp() instead, it'll send the file to the client and allow the client to select where to save it and what to save it as.
src << ftp("ServerFile.ext") |
In response to Nadrew
|
|
Nadrew wrote:
Unfortunately that's not how file() works. Correct me if I am wrong but this src<<file("ReadMe.txt") will open the file on the client's computer. After that, the client can simply save it in his computer. |
In response to Misticone
|
|
And just a comment on the code you did post, that's some terrible stuff in general. You're making a tmp variable for "Host_" but not type-casting it, so you're forcing yourself to use the : operator (which should really never be used outside of some very niche situations), and you're looping over the world needlessly when you should just be setting a reference to the host when they join the game and using that.
var/tmp/client/Host Although, ideally you'd make this a verb that's only accessible to the host, and simply have them select from a list of players (which should also be manually handled instead of looping over the world) |
In response to Misticone
|
|
Misticone wrote:
Nadrew wrote: It'll attempt to load the file without giving the client any control over how it loads it, which is far from ideal in this situation since just opening a savefile isn't going to do you much good. There's not going to be an easy way to save the file after the fact to the local file system either, you'd be jumping through a ton of needless hoops. The OP asked how to download the file, not view it :) |
In response to Nadrew
|
|
Humm ok Nadrew, thanks. I guess we always learn by making mistakes.
|
Thank you for all of your replays :)
I didn't know about the FTP command before.. But what should I do if I'd like to save the whole Folder instead of a single file? Will specifying the folder name (and it's path) in the ftp command be enouge? |
You'd want to look into http://www.byond.com/developer/Dantom/zipfile, probably.
|
Maybe you can do something like:
PS: I haven't tested this yet so please let me know if there is any problem.