이것은 내 업로드 시스템 코드이며, 파일을 업로드하고 mysql에 정보를 입력합니다. 작은 파일은 잘 작동하지만 큰 파일은 ftp에 나타나지 않으며, mysql 항목을 작성하지만 항목이 비어 있습니다.대용량 파일 업로드 안함
<?php
$count = 0;
if ($_SERVER['REQUEST_METHOD'] == 'POST'){
foreach ($_FILES['files']['name'] as $i => $name) {
if (strlen($_FILES['files']['name'][$i]) > 1) {
if (move_uploaded_file($_FILES['files']['tmp_name'][$i], 'upload/'.$name)) {
$count++;
}
}
}
}
?>
<?php
$link = mysql_connect('server', 'user', 'pass');
if (!$link) {
die('Could not connect: ' . mysql_error());
}
mysql_select_db(database);
$title = $_POST['title'];
$path= $name;
$description = $_POST['description'];
$sql = "INSERT INTO `videos` (`id` , `title` , `path` , `description`)
VALUES (
NULL , '$title', '$path', '$description'
);";
$result=mysql_query($sql);
if(! $result)
{
die('Could not update database: ' . mysql_error());
}
echo "Uploaded successfully\n";
mysql_close();
?>
페이지
<body>
<div class="wrap">
<form action="upload_script.php" method="post" enctype="multipart/form-data" name="form1" id="form1">
<form method="post" enctype="multipart/form-data">
<input type="file" name="files[]" id="files" multiple directory="" webkitdirectory="" mozdirectory="">
<INPUT TYPE = "Text" VALUE ="title" NAME = "title">
<textarea name="description">descrtiption</textarea>
<input class="button" type="submit" value="Upload" />
</form>
</div>
</body>
</html>
오류를 켜기 만합니까? 아마도 최대 업로드 크기로 할 것입니다. – putvande