|
 |
|
มาอีกรอบเรื่องเช็คไฟล์ภาพ IE เช็คได้ปกติ แต่ filefox มันเช็คไม่ได้มันเพี้ยนๆ |
|
 |
|
|
 |
 |
|
อืมๆๆอย่างงี้นี้เอง หมาแดงนี้เล่นเอาปวดกระบานเลยแหะ ขอบคุณครับ search เจอพอดีวันนี้+ให้มิได้ล่ะติดไว้ก่อนนะ
เดียวจะบวกให้ครับ
เหลือแต่ว่าจะเช็คยังไงดีไอความกว้างเนีย เดียวลองเล่น java ดูไปก่อนระหว่างรอ
|
 |
 |
 |
 |
Date :
2009-09-30 16:45:11 |
By :
somparn |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
Imagetype Constants
Value Constant
1 IMAGETYPE_GIF
2 IMAGETYPE_JPEG
3 IMAGETYPE_PNG
4 IMAGETYPE_SWF
5 IMAGETYPE_PSD
6 IMAGETYPE_BMP
7 IMAGETYPE_TIFF_II (intel byte order)
8 IMAGETYPE_TIFF_MM (motorola byte order)
9 IMAGETYPE_JPC
10 IMAGETYPE_JP2
11 IMAGETYPE_JPX
12 IMAGETYPE_JB2
13 IMAGETYPE_SWC
14 IMAGETYPE_IFF
15 IMAGETYPE_WBMP
16 IMAGETYPE_XBM
Code (PHP)
if($_SERVER['REQUEST_METHOD'] == "POST")
{
$uploadfile = $uploaddir . basename($_FILES['userfile']['name']);
echo '<pre>';
$maxWidth = 500;
$maxHeight = 500;
list($width, $height, $type, $attr) = getimagesize($_FILES['userfile']['tmp_name']);
if($width < $maxWidth && $height < $maxHeight && ($type == 1 || $type == 2)) // type ดูจากตาราง
{
if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) {
echo "File is valid, and was successfully uploaded.\n";
} else {
echo "Possible file upload attack!\n";
}
print "</pre>";
} else {
echo "invalid type or size of image!\n";
}
}
|
 |
 |
 |
 |
Date :
2009-09-30 17:10:20 |
By :
lozomac |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|


|
 |
 |
 |
 |
Date :
2009-09-30 17:14:00 |
By :
pokultra |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 02
|