|
|
|
ช้วย ดูสคลิป พออัพโหลดไฟล์ขนาด ใหญ่ มันไม่ Save ใน Folder |
|
|
|
|
|
|
|
Code (PHP)
<?php
$form = "<form action='upload.php' method='post' enctype='multipart/form-data'>
<table width='380' border='0' align='center' cellpadding='0' cellspacing='0'>
<tr>
</tr>
<tr>
<td><div align='right'>Title :</div></td>
<td> </td>
<td width='210'><input type='text' name='title' class='input'></td>
<td width='33'> </td>
<td width='33'> </td>
</tr>
<tr>
</tr>
<tr>
<td><div align='right'>Detail :</div></td>
<td> </td>
<td><textarea name='description' class='input' ></textarea></td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td><div align='right'>File :</div></td>
<td> </td>
<td> <input type='file' name='myfile' class='input' />
</td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td><input type='submit' class='host_it' name='submitbutton' value='Upload' ></td>
<td> </td>
<td> </td>
</tr>
<tr>
</tr>
<tr>
<td colspan='6'><table width='374' border='0' cellspacing='0' cellpadding='0'>
<tr> </tr>
</table></td>
</tr>
</table></form>";
if($_POST['submitbutton'])
{
$title = $_POST['title'];
$description = $_POST['description'];
$name = $_FILES['myfile']['name'];
$type = $_FILES['myfile']['type'];
$size = $_FILES['myfile']['size'];
$tmpname = $_FILES['myfile']['tmp_name'];
$ext = substr($name, substr($name, '.'));
if ($name)
{
if($title && $description)
{
require("connect/connect.php");
$date = date("d-m-y");
$charset = "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890";
$length = 15;
for ($i = 0; $i <= $length; $i++)
{
$rand = rand() % strlen($charset);
$tmp = substr($charset, $rand, 1);
$code .= $tmp;
}
while($numrows != 0)
{
for ($i = 0; $i <= $length; $i++)
{
$rand = rand() % strlen($charset);
$tmp = substr($charset, $rand, 1);
$code .= $tmp;
}
$quert = mysql_query("SELECT token FROM file WHILE token='$code'");
$numrows = mysql_num_rows($quert);
}
mkdir("MyFile/$code", 0775);
move_uploaded_file($tmpname, "MyFile/$code/"."".$ext);
$query = mysql_query("INSERT INTO file VALUES ('', '$title', '$code', '$description', '$name', '$date', '$size')");
$file = "$name";
echo "<table width='380' border='0' cellspacing='0' cellpadding='0'>
<tr>
<td width='100' rowspan='5'><img src='images/text-file-icon.png' width='100' height='100' /></td>
<td width='4'> </td>
<td colspan='3'> </td>
</tr>
<tr>
<td> </td>
<td width='205'><strong>$file</strong></td>
<td width='33'> </td>
<td width='38'> </td>
</tr>
<tr>
<td height='19'> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td>Link Download : [ กรุณา Copy ลิงค์ ตรง Link Download ]</td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td><input type='text' value='http://upload.anime-channal.com/download.php?token=$code' class='input' /></td>
<td> </td>
<td><a href='javascript:poptastic('download.php?token=$code)'><img src='images/link.png' width='32' height='32' target='_parent' /></a></td>
</tr>
<tr>
<td></td>
<td> </td>
<td>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td><strong>HTML CODE</strong></td>
<td> </td>
<td> </td>
</tr>
<tr>
<td colspan='5'><table width='374' border='0' cellspacing='0' cellpadding='0'>
<tr>
<td width='106'> </td>
<td width='268'><input type='text' value='' class='input' /></td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
<tr>
<td> </td>
<td><a href='upload.php'><img src='images/host_it.jpg' width='89' height='38' border='0' /></a></td>
</tr>
</table></td>
</tr>
</table>
";
}
else
echo "<span class='error'><center>You did fill in the form.</center></span>$form";
}
else
echo "<span class='error'><center>That is not an File.</center></span> $form";
}
else
echo "$form";
?>
Tag : PHP
|
|
|
|
|
|
Date :
2012-10-30 14:06:46 |
By :
nukedonut1 |
View :
801 |
Reply :
3 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
อัพประมาณ10กว่า mb ก็ไม่ได้อ่ะคับ
|
|
|
|
|
Date :
2012-10-30 14:27:35 |
By :
nukedonut1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 05
|