Share your knowledge at the LQ Wiki.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 04-18-2004, 11:44 PM   #1
LQ Newbie
Registered: Mar 2004
Posts: 13

Rep: Reputation: 0
Cant upload a file bigger then 1mb with php

Hey again,

I just wrote a simple upload script and it wont let me upload a file bigger then 1 M. Internet explorer just says the page cannot be displayed, and a friend said he got a connection error of some sort.

Now i notice alot of peoples scripts have an HTML file seperate from the php file, i do not. Ill include the script at the end of this post.

My upload_max_filesize is 10M (exactly what it says) and my max_post_size is 8M. Memory limit is 20M, max_execution_time is 30, file_uploads is 1, and safe_mode is off. Everything seems to check out on the variable side, so any ideas?

PHP Code:

$readmefileTableSettings["header_colspan"] = 2;

$sql get_db_conn();
        if (
$upload_server) {
move_uploaded_file($_FILES['map']['tmp_name'],'/var/www/html/uploads/' $mod '/' $_FILES['map']['name']);
$mapfile $_FILES['map']['name'];
$sql->Query("INSERT server SET name = '$mapfile', mod = '$mod', status =1");
$contents["header"] = "Success!";
$contents["main"] .= "The file was uploaded successfully and is now avalible on our server\n";

// construct the news contents
$contents["header"] = "Upload to Server";
$contents["main"]  = "\t\t\t\t<tr bgcolor='" $TABLECELL_BACKGROUND_COLOR "'>\n";
$contents["main"] .= "\t\t\t\t\t<td>Map&nbsp;</td>\n";
$contents["main"] .= "\t\t\t\t\t<td align='right'><form method='post' action='?mode=uploadserver&upload_server=1' enctype='multipart/form-data' ><input type='file' name='map'></td>\n";

$contents["main"] .= "\t\t\t\t<tr bgcolor='" $TABLECELL_BACKGROUND_COLOR "'>\n";
$contents["main"] .= "\t\t\t\t\t<td>Mod:</td>\n";
$contents["main"] .= "\t\t\t\t\t<td colspan=2 align='right'><input type='radio' name='mod' value='valve'>Valve HL\n";
$contents["main"] .= "\t\t\t\t\t<input type='radio' name='mod' value='cstrike'>Counter-Strike\n";
$contents["main"] .= "\t\t\t\t\t<input type='radio' name='mod' value='tfc'>TFC</td>\n";
$contents["main"] .= "\t\t\t\t</tr>\n";
$contents["main"] .= "\t\t\t\t<tr bgcolor='" $TABLECELL_BACKGROUND_COLOR "'>\n";
$contents["main"] .= "\t\t\t\t\t<td colspan=2 align='right'>Make sure you've read about this service, and that the server is mostly playing CS!</td>\n";
$contents["main"] .= "\t\t\t\t</tr>\n";

$contents["main"] .= "\t\t\t\t<tr bgcolor='" $TABLECELL_BACKGROUND_COLOR "'>\n";
$contents["main"] .= "\t\t\t\t\t<td colspan=2 align='right'><input type='submit' value='Upload'></form></td>\n";
$contents["main"] .= "\t\t\t\t</tr>\n";


$msg_tag = -10009;
Old 04-19-2004, 01:54 AM   #2
LQ Newbie
Registered: Mar 2004
Posts: 13

Original Poster
Rep: Reputation: 0
I found the problem.

In /etc/httpd/conf.d/php.conf

You have to edit [some value, i forgot the name] something about Limit. Its like right smack dap in the middle. Its set to 512kb. I think and admin should make a post about this, it can be a pain.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
upload 4-5MB/s, download ~1MB/s, redhat 9.0 2.4.20-8 (maybe hdd-related problem) tine Linux - Networking 0 09-13-2004 07:44 AM
i can upload file that is greater than 1MB marconi8 Linux - General 0 12-17-2002 09:13 AM
i cannot trough SQUID upload more than 1MB, WHY? :( marconi8 Linux - General 0 12-17-2002 04:45 AM
File upload via PHP saravanan1979 Programming 1 02-14-2002 04:28 AM
File upload via PHP!!! saravanan1979 Programming 0 02-14-2002 01:55 AM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 02:20 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration