p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   PHP Databases (http://p2p.wrox.com/forumdisplay.php?f=97)
-   -   how to upload files > 1mb into mysql from php (http://p2p.wrox.com/showthread.php?t=1379)

zubair_k911 July 8th, 2003 08:57 AM

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

nikolai July 8th, 2003 11:24 AM

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/

zubair_k911 July 10th, 2003 07:36 AM

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

nikolai July 10th, 2003 02:07 PM

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/


All times are GMT -4. The time now is 03:22 PM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.