For Pre 5.5 UBBThreads boards (for 5.5 beta and up skip to the bottom)
</font><blockquote><font size="1" face="">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">Uploads on Windows servers:

1: open php.ini and set the upload directory so it looks like:

upload_tmp_dir = C:\WINDOWS\Temp\

You can use any directory you want but make sure it exists and that it is formatted like above with
double \ and don't forget to add them at the end of the line.

2: open addpost.php and look for

// Doesn't support it, so we write our own function

this is towards the bottom of the file. Now you want to comment out the following lines.

/* else {
$filename = $userfile;
if (!$tmp_file = get_cfg_var('upload_tmp_dir')) {
$tmp_file = dirname(tempnam('', ''));
}
$tmp_file .= '/' . basename($filename);
$validfile = (ereg_replace('/+', '/', $tmp_file) == $filename);
if ($validfile) {
$goodfile = "yes";
}
}

if ($goodfile == "yes") { */

I commented mine like above with /* at the begining and */ at the end. You could also just
delete the block above.

Now look for

// Update the post to set the file name
$Filename_q = addslashes($FileName);
$query = "
UPDATE w3t_Posts
SET B_File = '$Filename_q'
WHERE B_Number = '$Mnumber'
AND B_Board = '$Board_q'
";
$dbh -> do_query($query);

This is just below the 2 lines you will leave uncommented above. Just below the last line
comment out the } There is 2 of them just comment out the first.


When you are all finished that part of the script will look like this.

// Doesn't support it, so we write our own function
/* start comment here

else {
$filename = $userfile;
if (!$tmp_file = get_cfg_var('upload_tmp_dir')) {
$tmp_file = dirname(tempnam('', ''));
}
$tmp_file .= '/' . basename($filename);
$validfile = (ereg_replace('/+', '/', $tmp_file) == $filename);
if ($validfile) {
$goodfile = "yes";
}
}

if ($goodfile == "yes") {

end comment here*/

$FileName = "$Mnumber-$userfile_name";
copy($userfile, "$config[files]/$FileName");

// ------------------------------------
// Update the post to set the file name
$Filename_q = addslashes($FileName);
$query = "
UPDATE w3t_Posts
SET B_File = '$Filename_q'
WHERE B_Number = '$Mnumber'
AND B_Board = '$Board_q'
";
$dbh -> do_query($query);
//comment this out }
}

All you need from that block of code is this

$FileName = "$Mnumber-$userfile_name";
copy($userfile, "$config[files]/$FileName");
}


Uploads will work on Windows now.[/code]</blockquote><font size="" face="">FAQ by Bob Schwarz
admin@visualbasicforum.com
Thanks Bob!

For 5.5 beta versions and up you need only make the changes to php.ini as in step 1. The rest has been changed for you already.

</font><blockquote><font size="1" face="">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">1: open php.ini and set the upload directory so it looks like:

upload_tmp_dir = C:\WINDOWS\Temp\

You can use any directory you want but make sure it exists and that it is formatted like above with
double \ and don't forget to add them at the end of the line.[/code]</blockquote><font size="" face="">Honor The Victims