All pastes #545575 Raw Edit

theblackbox

public php v1 · immutable
·published 2007-06-06 20:01 UTC
rendered paste body
function relo_submit($form_id, $form_values) {// Handles the uploading of the RELO to the files/relo directory// returns a URL for the RELO // var_dump($form_values); var_dump($_FILES);$source = $form_values['local'];$tmp_dest = $_FILES['tmp_name']['local'];$fnl_dest = 'sites/all/files/RELOs/' . $_FILES['name']['local'];  if (file_save_upload($source)) {	file_move($tmp_dest, $fnl_dest);	return 0;  }  else return 1;}__________________________________var_dump($_FILES) output:array(1) { 	["files"]=>  array(5) { 		["name"]=>  array(2) { 			["local"]=>  string(10) "README.txt" 			["upload"]=>  string(0) "" } 		["type"]=>  array(2) { 			["local"]=>  string(10) "text/plain" 			["upload"]=>  string(0) "" } 		["tmp_name"]=>  array(2) { 			["local"]=>  string(14) "/tmp/phpPHR0vc" 			["upload"]=>  string(0) "" } 		["error"]=>  array(2) { 			["local"]=>  string(1) "0" 			["upload"]=>  string(1) "4" } 		["size"]=>  array(2) { 			["local"]=>  string(4) "6222" 			["upload"]=>  string(1) "0" } } }