Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > PHP Databases
| Search | Today's Posts | Mark Forums Read
PHP Databases Using PHP in conjunction with databases. PHP questions not specific to databases should be directed to one of the other PHP forums.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the PHP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 24th, 2007, 09:33 AM
Authorized User
 
Join Date: Feb 2007
Location: IIT Kanpur, UP, India.
Posts: 25
Thanks: 0
Thanked 0 Times in 0 Posts
Default Upload .txt file of size 15 mb or more

Hello everybody,

I have to upload .txt file in mysql table. This data is to be displayed by using mysql queries. I have use upload .txt file by code shown below,


$destinationdir = "/var/www//html/telephone/uploadfiles/";
$destinationfile = $destinationdir . $_FILES['myfile']['name'];
 if(move_uploaded_file($_FILES['myfile']['tmp_name'],$destinationfile))
 {
  $bloadquery="load data local infile '$destinationfile' into table billtable fields terminated by '|' enclosed by '' lines terminated by '\\r\\n'";

   if(execute_query($bloadquery))
   {
      header("Location: uploadsuccess.php");
      exit;
   }
  .......
  ......
 }


This code working well for uploading 150000 (approx) lines means file of size in 50 kb but it fails for for uploading file having size 12 mb or more than 12 mb.

So please suggest me what changes I have to made to upload more than 12 mb file.

Thanks in advace.




 
Old October 24th, 2007, 06:34 PM
Authorized User
 
Join Date: Sep 2007
Location: , , .
Posts: 56
Thanks: 0
Thanked 1 Time in 1 Post
Default

Your php.ini file controls the max upload. By default it is set to 2mb.

You need to edit this variable in your php.ini file

upload_max_filesize

http://mynameissteve.com




Similar Threads
Thread Thread Starter Forum Replies Last Post
ch.2- cant upload a file no bigger than 52 MB?? cluce BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 5 April 30th, 2008 09:08 AM
ch. 2 what is the file size limit to upload? cluce BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 3 February 19th, 2008 04:48 PM
Uplad txt field of size greater than 12 mb rapraj PHP Databases 3 October 28th, 2007 09:36 AM
exact mb we can upload??.. asudhakar C# 1 April 4th, 2007 07:31 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.