Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > PHP/MySQL > PHP Databases
Password Reminder
Register
| FAQ | Members List | Calendar | 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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old July 8th, 2003, 08:57 AM
Registered User
 
Join Date: Jul 2003
Location: Braunschweig, Niedersachschen, Germany.
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
Reply With Quote
  #2 (permalink)  
Old July 8th, 2003, 11:24 AM
Friend of Wrox
Points: 2,570, Level: 21
Points: 2,570, Level: 21 Points: 2,570, Level: 21 Points: 2,570, Level: 21
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: San Diego, CA, USA
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/
Reply With Quote
  #3 (permalink)  
Old July 10th, 2003, 07:36 AM
Registered User
 
Join Date: Jul 2003
Location: Braunschweig, Niedersachschen, Germany.
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
Reply With Quote
  #4 (permalink)  
Old July 10th, 2003, 02:07 PM
Friend of Wrox
Points: 2,570, Level: 21
Points: 2,570, Level: 21 Points: 2,570, Level: 21 Points: 2,570, Level: 21
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: San Diego, CA, USA
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/
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



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


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