hi everyone, i have made a an uploader just for random files, here is the code:
<html>
<body>
<?
require ("clsUpload.php");
$upload = new Upload(&$HTTP_POST_FILES);
$upload->maxupload_size = 2000000; // 2,000,000 bytes, or 2mb
$field1_filename = $upload->getFileName("file1");
if ($upload->save($DOCUMENT_ROOT,$field1_filename ,true))
{
echo "Upload save sucessful.<BR>";
} else{
echo $upload->errors;
}
if ($upload->saveAs("usa_rep_".$field1_filename,$DOCUMENT_ROOT,"file1",true))
{
echo "Upload saveas sucessful.";
} else{
echo $upload->errors;
}
if ($upload->isPosted)
{
echo "<BR><BR><b>Some details about the upload:</B><BR>";
echo "Filename: ".$upload->getFileName("file1")."<BR>";
echo "Mime type: ".$upload->getFileMimeType("file1")."<BR>";
echo "File size: ".$upload->getFileSize("file1")."<BR>";
}
?>
<form enctype="multipart/form-data" method="post">
<input type="File" name="file1">
<input type="submit" value="upload">
</form>
<br>
<?
if ($upload->isPosted)
{
echo "File location: http://www.whatever.com/upload/$upload->getFileName("file1")."<BR>";
}
?><br>
After you upload all your replays, for each one, type this into the replay section of the forum:<br>
Title of replay name here **note: obviously replacing file location and Title of replay name here* approrietly<br>
EG, i just uploaded a rep of Bei playing Tillerman, and i get told the file location is: http://www.whatever.com/upload/usa_rep_bei vs tillerman.w3g<br>
Bei vs Tillerman<br>
<br>
Easy, your done, just rinse and repeat for all the replays you want posted.
</body>
</html>
it's obviously deisgned for IBF newbies, that cant use the uploader, so i just making this for a friend.
But on IBF, if you have spaces in the URL of the file it doesnt work...
Soooo if i used the uploader to upload a file maybe called...for example:
news polls and other stuff.txt
it would save it as usa_rep_news polls and other stuff.txt
with spaces in it. does anyone know how i could tell the code "all spaces are to be changed into underscores"?
i am pretty newbie, any response would be grateful 😉
P.S i didnt write the script orginally i just edited it a bit