Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > PHP Databases
|
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 July 8th, 2003, 08:57 AM
Registered User
 
Join Date: Jul 2003
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default how to upload files > 1mb into mysql from php

hello every one

i am new to this group.

can any one help me out how to uplad files greater than 1 mb into mysql database from a php page. i have sucessfully written a programme from which i am able to upload files less than 1 mb into mysql database.

i have cahnged php.ini as follows:

The parameters are:
max_execution_time = 3000
memory_limit = 16M
post_max_size = 80M

; File Uploads ;
;;;;;;;;;;;;;;;;
file_uploads = On
upload_tmp_dir = /tmp
upload_max_filesize = 80M


can any one hlp me in this case.

thank you.

zubair
 
Old July 8th, 2003, 11:24 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 836
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Your problem might not be uploading the file, it might be that the table/column you're inserting the data into has a size restriction on it. Double check the column data type and make sure it's able to hold large amounts of data.

It also be that you're timing out when uploading larger files. Try changing your max_execution_time to something larger, say 30000, just for testing purposes.

FWIW, I think the best approach is to upload files to the filesystem and insert the path to the file in the database, not the contents of the file itself.


Take care,

Nik
http://www.bigaction.org/
 
Old July 10th, 2003, 07:36 AM
Registered User
 
Join Date: Jul 2003
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hello nikolai

thank you for ur reply.

i use mysql and i use long blob as the datatype to the column in which i have to upload the files. and in mysql lonblob datatype the maximum storage can be 2^32 bytes. which is almost 80 mb





zubair
 
Old July 10th, 2003, 02:07 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 836
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Okay, someone agrees with me about NOT inserting files into a database! Read this other current thread:
  http://p2p.wrox.com/topic.asp?TOPIC_ID=1528


Take care,

Nik
http://www.bigaction.org/





Similar Threads
Thread Thread Starter Forum Replies Last Post
upload files from php to my ISP / server? danielnixon Beginning PHP 0 April 22nd, 2008 10:51 AM
Cannot Upload file >1MB shweta_999 ASP.NET 2.0 Professional 1 December 19th, 2006 02:37 AM
Upload Files of Greater Size (>5Mb) saravananedu ASP.NET 1.0 and 1.1 Basics 1 May 4th, 2005 12:07 AM
Linux >> Windows files MAtkins C++ Programming 2 October 14th, 2003 05:37 PM
php.ini -> regisiter globals -> On = BAD? troinfo Beginning PHP 7 July 21st, 2003 02:48 PM





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