这是我的上传系统的代码,它上传文件并将信息输入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>