phpbar.de logo

Mailinglisten-Archive

[php] fileupload mit php

[php] fileupload mit php

Tobias Orterer php_(at)_phpcenter.de
Mon, 11 Jun 2001 17:53:05 +0200


file_create($id,$file,$file_name,$file_size);

function file_create($id,$file,$name,$size) {
	include("extension/config.php");
	if(isset($file)) {
		// Bugfix für: http://www.securityfocus.com/archive/1/80106 ->
koehntopp.de
		if(isset($HTTP_COOKIE_VARS["file"]) || isset($HTTP_POST_VARS["file"])
|| isset($HTTP_GET_VARS["file"])) {
			die("Aus Sicherheitsgründen stirbt das Script jetzt.");
		}
		$new_file_name = md5(uniqid(microtime()));
		$timestamp = date("YmdGis");
		if(copy($file, $files_folder.$new_file_name)) {
			mysql_query("INSERT INTO $files_table
VALUES('','$id','$name','$new_file_name','$size','$timestamp')");
		}
	}
}

so mach ich das... ;o)

-- 
Tobias Orterer
home(01747688873  && (der_(at)_tobi.li || sms("www.tobi.li"))
work(080417994725 && (to_(at)_iat-matrix.de || tobi_(at)_openwi.de)


php::bar PHP Wiki   -   Listenarchive