I need help
I am creating a file system for my laptop and i am usiing wamp as my server. I can upload a file up to my server no bother, but when i try i video i get an error with the submit button. I want to be able to put a small video up there, do i need a max_file_size method included. PLease help . . . .
This is my html file(upload.html)
<html>
<body>
<form action="upload.php" method="POST" enctype="multipart/form-data">
<input type="hidden" name="MAX_FILE_SIZE" value="16777000" />
<table>
<tr>
<td>Heading:</td>
<td><input type="text" name ="Heading"></td>
</tr>
<tr>
<td>Description:</td>
<td><textarea name="Description" cols="35" rows="5"></textarea></td>
</tr>
<tr>
<td></td>
<td><input type="file" name="testfile" id="file"></td>
</tr>
<tr>
<td></td>
<td><input type="submit" name="submitbutton" value="Submit"></td>
</tr>
</table>
</form>
</body>
</html>
And this is my php file (upload.php)
<?php
echo "<title>PHP File Upload</title>";
if ($_POST["submitbutton"])
{
$heading = $_POST["Heading"];
$description = $_POST["Description"];
$name = $_FILES["testfile"]["name"];
/*if($name == $_SESSION["last_file_name"])
{
die("File already uploaded");
}*/
$type =$_FILES["testfile"]["type"];
$size = $_FILES["testfile"]["size"];
$tmp_name = $_FILES["testfile"]["tmp_name"];
// $_SESSION["last_file_name"] = $name;
echo "<b>" . "File Name: " . "</b>" . $name . "<br />";
echo "<b>" . "Type of File: " . "</b>" . $type . "<br />";
echo "<b>" . "File Size: " . "</b>" . $size . "<br />";
echo "<b>" . "Stored: " . "</b>" . $tmp_name . "<br />";
if($heading && $description)
{
require("connection.php");
$date = date("d-M-Y");
$query = mysql_query("INSERT INTO filesuploaded VALUES('','$heading', '$description', '$date' )");
move_uploaded_file($tmp_name,'filesuploaded/'. $name);
echo "<b>" . "The file " . "</b>" . $name . "<b>" . " has been uploaded <br><br> <a href='download.php?file=$heading'>Download file </a>" . "</b>" ;
}
else
{
echo "Your heading and Description has not been filled .$form";
}
//header("location:download.php");
}
else
//echo "$form";
echo "file not uploaded";
?>
The connection.php is the fiel that connect to mysql
please help me
This post has been edited by JackOfAllTrades: 24 April 2010 - 11:18 AM
Reason for edit:: Added code tags.

New Topic/Question
Reply
MultiQuote







|