|
-
Sep 25th, 2007, 03:52 AM
#1
Thread Starter
Fanatic Member
how to upload above 1MB file using PHP
hai,
I am trying to upload a file which is 3.4MB(gif file).according to my code i am storing the file in folder named advertisment.If i upload above 1.5MB ,the file get uploaded in the database,but not in the folder.if i did less than that..the file is available..
i have also cHanged the php.ini file..upload_max_file=8MB,I have used enctype="multipart/form-data"
this is my code..
PHP Code:
<?
if(isset($_POST['submit']))
{
$ext=substr($_FILES["photo"]["name"],-4);
$category=$_POST['category'];
$date=date('Y-m-d');
$sql_check="select * from conadv where category='$category'";
$query_check=mysql_query($sql_check) or die(mysql_error());
$num=mysql_num_rows($query_check);
if($num==0)
{
$sql_advertisment="insert into conadv(photo,category,date) values('$ext','$category','$date')";
$query_advertisment=mysql_query($sql_advertisment) or die(mysql_error());
$id=mysql_insert_id();
$filename="conadv".$category.$id.$ext;
$uploadFile = "../advertisment/".$filename;
if (copy($_FILES["photo"]["tmp_name"], $uploadFile))
{
//header("loaction:viewmain.php");
}
}
else
{
$error="Alredy Exists";
}
}
?>
kindly help me friends...try to solve this pbm
Last edited by penagate; Sep 25th, 2007 at 04:30 AM.
Reason: Added [php] tags
Visual Studio.net 2010
If this post is useful, rate it

Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|