View Single Post
  #3  
Old 09-10-2013, 05:33 AM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
That's a Client-RC function, and a terrible file browser.

With solely just script.

PHP Code:
function onCreated() {
  
temp.file.loadstring("level/path/to/file.png");
  
temp.data base64encode(temp.file);
  
player.triggerclient("weapon"this.name"file""file.png"temp.data);
}

//#CLIENTSIDE

function onActionClientSide() {
  if (
params[0] == "file") {
    
temp.data base64decode(params[2]);
    
temp.data.savestring(params[1], 0); // Saves to Graal/scriptfiles/Servername/file.png
    
echo("Downloaded " params[1] @ "!");
  }

Side note, just stumbled upon these functions in /scripthelp:

generatezipstring(obj) - returns string - creates a zip in memory from the array you provide like {filename, content, filename, content, ...}, save to file using str.savestring(filename, 0)
decompressfile(str, str, str, int) - returns boolean - parameters are filename, file name pattern (*), destination folder and flags (1 (keep zip paths) + 2 (keep original modification time)); unzips a file into the specified folder
__________________
Quote:
Reply With Quote