Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > Pro PHP
|
Pro PHP Advanced PHP coding discussions. Beginning-level questions will be redirected to the Beginning PHP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Pro PHP 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 29th, 2004, 01:31 PM
Authorized User
 
Join Date: May 2004
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default File upload problems in PHP 4.3.2

 Hello,

I have an upload script that worked fine until I moved it to a server w/ php 4.3.2. Now when I browse in a file and hit submit, I get a "document contains no data" error.

This happens when I reach a certain file size limit.

I went to php.ini and set post_max_size = 20M
and set upload_max_filesize = 20M

I also did set this in the actual form code:
<input type="hidden" name="MAX_FILE_SIZE" value="4000000">

None of this seemed to effect anything.

Also, I was getting the "document contains no data" error when the files were only 1.9 mb.

Any ideas?

Thanks,
clem C

 
Old November 1st, 2004, 05:45 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 101
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via AIM to Moharo
Default

hey there

i don't really know the solution to your problem, but this is what you can do:

1. check if you have "chmod 777" on the directory that you are uploading files to.
2. in the page where it says "document contains no data", include this for debuggin:

<?php

print_r($_FILES);

?>

3. check out http://pl.php.net/manual/en/features.file-upload.php for more about handling file uploads and

personally i do not use the <input type=hidden name="MAX_FILE_SIZE">, just use $_FILES[__NAME__]["size"] to get the file size, where __NAME__ is the name of your <input type=file>

also, you may use $_FILES[__NAME__]["error"], if $_FILES[__NAME__]["error"] == 0 then there was no file uploaded or check this link: http://pl.php.net/manual/en/features...oad.errors.php

peace

:D

www.campusgrind.com the college portal
 
Old November 1st, 2004, 10:49 AM
richard.york's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts
Default

Did you check phpinfo() to verify the new ini values had taken effect?

Regards,
Rich

--
[http://www.smilingsouls.net]
[http://pear.php.net/Mail_IMAP] A PHP/C-Client/PEAR solution for webmail





Similar Threads
Thread Thread Starter Forum Replies Last Post
How to upload mp3 file using php abhi.sharma05 PHP How-To 4 November 1st, 2011 11:59 PM
asp file upload script having problems with MYSQL paulmcn Classic ASP Databases 0 September 16th, 2005 01:26 PM
Chapter 7 file upload problems GranDad BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 1 August 27th, 2005 02:29 PM
PHP file upload qazi_nomi PHP How-To 2 July 11th, 2004 10:43 PM
php file upload reason1000 BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5 0 June 7th, 2003 10:49 PM





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