Ja jeg vil bruge denne her til at uploade ind på serveren men jeg har et problem serveren jeg uploader til kender ikke fil typen jpg og gif er der nogle der kan lave det så det viker 100% personen får 200 points
Du kan se en test af den her på www.mpj.fastweb.dk
<HTML>
<HEAD>
<TITLE>Signatur Upload!!!</TITLE>
</HEAD>
<BODY bgcolor="#FFFFFF">
<p align="center"> </p>
<?
### Configuration ###
# What directory should the files be uploaded to ? ( Remeber to chmod 777 your_upload_dir )
$upload_directory = "/web/www/fastweb/users/mpj";
# The Max Upload Size of a file when upload to server!
$max_upload_size = "102400"; // Set to 100 kB
# What type of files should be allowed to be uploaded ?
//$allow_type = "audio/mpeg"; // This is the tag to only allow *.MP3 files to be uploaded!
$allow_type=Array();
$allow_type[]='jpg';
$allow_type[]='gif';
# Shall the script only allow 1 file type to be uploaded ?
$allow_file_type = "1"; // Only allows 1 file to be uploaded to server!
### Font setup ###
$font = "verdana";
$font_size = "2";
$font_color = "black";
### Error Messages ###
# No file to upload
$no_file = "<b><font face=\\"$font\\" size=\\"$font_size\\" color=\\"$font_color\\">Sorry, but you didn't select a file to upload";
# File is to big
$to_big_file = "<b><font face=\\"$font\\" size=\\"$font_size\\" color=\\"$font_color\\">Sorry, but the file you have select is to big to be uploaded!";
# Not the correct filetype
$not_correct_file = "<b><font face=\\"$font\\" size=\\"$font_size\\" color=\\"$font_color\\">Sorry, but the file you tried to upload is not valid file to upload! We do not allow $type";
# Error to write file to upload directory
$error_write_file = "<b><font face=\\"$font\\" size=\\"$font_size\\" color=\\"$font_color\\">Sorry, but there has been an error processing $file_name to the
$upload_directory! Please try again later!";
# The file is already uploaded
$already_uploaded = "<b><font face=\\"$font\\" size=\\"$font_size\\" color=\\"$font_color\\">Sorry, the file already Exists on server!";
### Thank You Message(s) ###
$thank_you = "<b><font face=\\"$font\\" size=\\"$font_size\\" color=\\"$font_color\\">
http://www.mpj.fastweb.dk/$file_name";
####### Code Starting #######
if (!$file_name) die("$no_file");
if ($file_size > $max_upload_size) {
die("$to_big_file");
}
if ($allow_file_type == "1") {
if (!in_array(strrchr($file_name,'.'),$allow_type)) {
die("$not_correct_file");
}
}
if (file_exists("$upload_directory/$file_name")) {
die("$already_uploaded");
}
@copy($file, "$upload_directory/$file_name") or die("$error_write_file");
# EOF!
echo "<center><b>$thank_you";
?></font></font></font></font></font></font>
</BODY>
</HTML>