ํฐ์คํ ๋ฆฌ ๋ทฐ
Saving the Uploaded File
<?php
$allowedExts
=
array
(
"gif"
,
"jpeg"
,
"jpg"
,
"png"
);
$temp
=
explode
(
"."
,
$_FILES
[
"file"
][
"name"
]);
$extension
=
end
(
$temp
);
if
(((
$_FILES
[
"file"
][
"type"
] ==
"image/gif"
)
|| (
$_FILES
[
"file"
][
"type"
] ==
"image/jpeg"
)
|| (
$_FILES
[
"file"
][
"type"
] ==
"image/jpg"
)
|| (
$_FILES
[
"file"
][
"type"
] ==
"image/pjpeg"
)
|| (
$_FILES
[
"file"
][
"type"
] ==
"image/x-png"
)
|| (
$_FILES
[
"file"
][
"type"
] ==
"image/png"
))
&& (
$_FILES
[
"file"
][
"size"
] < 20000)
&& in_array(
$extension
,
$allowedExts
)) {
if
(
$_FILES
[
"file"
][
"error"
] > 0) {
echo
"Return Code: "
.
$_FILES
[
"file"
][
"error"
] . "
";
}
else
{
echo
"Upload: "
.
$_FILES
[
"file"
][
"name"
] . "
";
echo
"Type: "
.
$_FILES
[
"file"
][
"type"
] . "
";
echo
"Size: "
. (
$_FILES
[
"file"
][
"size"
] / 1024) . " kB
";
echo
"Temp file: "
.
$_FILES
[
"file"
][
"tmp_name"
] . "
";
if
(
file_exists
(
"upload/"
.
$_FILES
[
"file"
][
"name"
])) {
echo
$_FILES
[
"file"
][
"name"
] .
" already exists. "
;
}
else
{
move_uploaded_file(
$_FILES
[
"file"
][
"tmp_name"
],
"upload/"
.
$_FILES
[
"file"
][
"name"
]);
echo
"Stored in: "
.
"upload/"
.
$_FILES
[
"file"
][
"name"
];
}
}
}
else
{
echo
"Invalid file"
;
}
?>
'์น ์ฝ๋ฉ > php' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
Restrictions on Upload (0) | 2015.03.31 |
---|---|
Create The Upload Script (0) | 2015.03.31 |
Create an Upload-File Form (0) | 2015.03.31 |
PHP Overwriting (0) | 2015.03.31 |
PHP Write to File - fwrite() (0) | 2015.03.31 |
๊ณต์ ํ๊ธฐ ๋งํฌ
๋๊ธ
๊ณต์ง์ฌํญ
์ต๊ทผ์ ์ฌ๋ผ์จ ๊ธ
์ต๊ทผ์ ๋ฌ๋ฆฐ ๋๊ธ
- Total
- Today
- Yesterday
๋งํฌ
- W3Schools (W3์ค์ฟจ)
- ์ํ์ฝ๋ฉ
- ์จ์๋ก๊ทธ
- ์น์ ์ฌ๋ํ๋ ์ฌ๋๋ค
- ์์ฏ๋ท์ปด
- Create a new fiddle - JSFiddle
- ThemeForest
- dribbble(๋์์ธ๊ด๋ จ)
- XDSoft plugins(์ ์ด์ฟผ๋ฆฌ ํ๋ฌ๊ทธ์ธ์์ค)
- Free jQuery Plugins and Tutori…
- comfytube: relax (์ฌ์ฆ์์ )
- ์ข์ถฉ์ฐ๋ ์นํผ๋ธ๋ฆฌ์ ์ผ๊ธฐ
- Sensio Arbor
- ์น๋์์ธ ํฌํ ์ต
- ๊ทธ๋ ๊ณ ๊ทธ๋ฐ ์ด์ผ๊ธฐ
- ๊ณต๊ตฐ ๊ณต๊ฐ
- Itnamu์ ํผ์๋๊ธฐ
- ์นํผ๋ธ๋ฆฌ์ ์ ์๋ฐ์คํฌ๋ฆฝํธ&HTML
TAG
- ์นดํ24์ผํ๋ชฐ ๋ชจ๋ฐ์ผ
- Ajax๋ก๋ฉ
- ์นดํ24๋ชจ๋ฐ์ผ
- ์นดํ24์ผํ๋ชฐ
- ํด๋ฆฌ์ค
- ์นดํ24์ผํ๋ชฐ๋ชจ๋ฐ์ผ
- ์นดํ24
- ์นดํ24์ผํ๋ชฐ ์คํจ
- ์ด๋ฐ๋์ผ์ด
- ์ฌ๋ฆฌ๋ธ์ 6์ ์ธ์ผ
- ์ ์ด์ฟผ๋ฆฌ ๋ก๋ฉ
- ์ฌ๋ฆฌ๋ธ์ ์ธ์ผ
- ์นดํ24 ์คํจ
- 6์ ์ธ์ผ
- ์ ๋ ํธ๋ฐ์ค์ฒดํฌ
- ๋ฅํฐ์ง
- ์ฌ๋ฆฌ๋ธ์
- ๋ก๋ฉ์ด๋ฏธ์ง
- jquery๋ก๋ฉ
- ํ ์คํธ์์์ฒดํฌ
- ์กฐํ๋ก๋ฉ
- Mac
- ๊ตฌ๊ธ์ง๋
- ๋ผ๋์ค๋ฒํผ์ฒดํฌ
- Ajax
- ์นดํ24๋ชจ๋ฐ์ผ์นดํ
- ์นดํ24 ๋ชจ๋ฐ์ผ
์ผ | ์ | ํ | ์ | ๋ชฉ | ๊ธ | ํ |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
๊ธ ๋ณด๊ดํจ