%s\n", mysql_errno (), mysql_error (), $query); mysql_close ($conn_id); } header("Location: $HTTP_REFERER"); // printf ("Your file %s was deleted.
\n", $id); unset ($id, $delete); } } if ($id) { include("../include/config.inc.php"); $conn_id = mysql_connect ("$cfg_dbname","$cfg_dbuser","$cfg_dbpasswd"); mysql_select_db ("$cfg_db"); $query = "select * from $cfg_docstable where id = $id"; $res_id = mysql_query ($query, $conn_id); if (! $res_id) { printf ("MySQL Error: (%d) %s

%s\n", mysql_errno (), mysql_error (), $query); mysql_close ($conn_id); exit (); } $row = mysql_fetch_array ($res_id); if ($row) { $data = $row["bin_data"]; $type = $row["filetype"]; $filename = $row["filename"]; mysql_close ($conn_id); Header ("Content-disposition: filename=".$filename); Header ("Content-type: $type"); echo $data; exit (); } else { printf ("There were no rows found with id = %d\n", $id); mysql_close ($conn_id); } } ?> File Depository \n"); unset ($id); $file_size = filesize ($input_file); if ($file_size == "") { $errmsg="Empty file"; } if (!$errmsg) { printf ("Your file %s was successfully uploaded.
\n", $input_file_name); } else { printf ("$errmsg") ; exit; } $fp = fopen ($input_file, 'r'); $data = addslashes (fread ($fp, $file_size)); fclose ($fp); unlink ($input_file); mysql_connect ("$cfg_dbname","$cfg_dbuser","$cfg_dbpasswd"); mysql_select_db ("$cfg_db"); $res_id = mysql_query ("insert into $cfg_docstable values ( 0, '$description', '$data', '$input_file_name', '$input_file_size', '$input_file_type', '$ID', '$category' )"); $new_id = mysql_insert_id (); mysql_close (); if ($new_id > 0) { printf ("Database id for your file: %s
\n", $new_id); } else { printf ("Your file insertion failed!\n"); } printf ("

\n"); } ?>
"; mysql_connect("$cfg_dbname","$cfg_dbuser","$cfg_dbpasswd") or die(mysql_error()); $result=mysql_db_query("$cfg_db", "$query"); $numrows=mysql_num_rows($result); $i=0; while ($r=mysql_fetch_array($result)) { $i=$i+1; $bgcolor = ($i % 2) ? DDDDDD: EEEEEE; $did = $r["id"]; $ddescription = $r["description"]; $dfilename = $r["filename"]; $drefid = $r["refid"]; $dcategory = $r["category"]; $dfilesize = $r["filesize"]; $dfiletype = $r["filetype"]; ?>
Description File Name File size File Type  
   
[Delete]