1 2 3 4 5 6 7 8 9 10 11 12 13 | <!DOCTYPE html> < html > < head > < meta charset = "utf-8" /> </ head > < body > < form enctype = "multipart/form-data" action = "1.php" method = "POST" > < input type = "hidden" name = "MAX_FILE_SIZE" value = "30000" /> < input name = "userfile" type = "file" /> < input type = "submit" value = "upload" /> </ form > </ body > </ html > |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | <!DOCTYPE html> <html> <head> <meta charset= "utf-8" /> </head> <body> <?php ini_set ( "display_errors" , "1" ); $uploaddir = 'C:\BitNami\wampstack-5.4.20-0\apache2\htdocs\upload\file\\' ; $uploadfile = $uploaddir . basename ( $_FILES [ 'userfile' ][ 'name' ]); echo '<pre>' ; if (move_uploaded_file( $_FILES [ 'userfile' ][ 'tmp_name' ], $uploadfile )) { echo "파일이 유효하고, 성공적으로 업로드 되었습니다.\n" ; } else { print "파일 업로드 공격의 가능성이 있습니다!\n" ; } echo '자세한 디버깅 정보입니다:' ; print_r( $_FILES ); print "</pre>" ; ?> </body> </html> |