Jump to content
php.lv forumi

Can't upload files bigger than 1,90 MB


dxshindeo

Recommended Posts

Hi, everyone!

 

I can't upload files bigger than 1,90 MB. 1,89 still works fine, but server refuses if higher.

 

php.ini ->

post_max_size = 100M

upload_max_filesize = 100M

 

Actually, the problem was that I was able to upload only 1 MB, problem was in mysql, fixed it by running sql commands:

 

SET GLOBAL max_allowed_packet = 104857600; /*Theoretically this should let me upload and insert files with maximum size of 100 MB, but practically it raised the bar from 1 MB to 1,90 MB*/

 

SET GLOBAL net_read_timeout = 3600; /*This was 30, dunno why I even touched this*/

 

Field in mysql has LONGBLOB type, so it can contain a file ~4GB.

 

Working with Win7 and I have installed and configured Apache2.2, MySQL Workbench 5.2.40 and PHP 5.2.17 (VC6 x86 Thread Safe version).

 

Would appreciate any thoughts on the matter smile.gif

Link to comment
Share on other sites

Using Apache2.2, in httpd configuration file added:

 

LoadModule php5_module "c:/php/php5apache2_2.dll

AddType application/x-httpd-php .php"

 

So the Apache can interact with PHP.

Restarted Apache, nothing changes.

 

What did you meant by mysqld?

 

Checked my processes, have httpd and mysqld both up and running.

Link to comment
Share on other sites

I meant that you should restart MySQL daemon (process, if you are using Windows). But, anyway, it won't change anything...

 

What's the exact response from server when you are trying to upload file higher than 1.9 Gb. Any error?

Link to comment
Share on other sites

"1.9 Gb" - 1.9 MB :)

 

Ok, here's part of my code (big query and an if-else statement):

 

$result = mysql_query("INSERT INTO arhivs (prieksmets, prieksmets_full_name, nosaukums, tips, formats, izmers, autors, datums, laiks, path, saturs) VALUES ('$prieksmets', '$prieksmets_full_name', '$fileName', '$fileType', '$fileExt', '$fileSize', '$autors', '$datums', '$laiks', '$newpath', '$content')");

if($result==true)
{
move_uploaded_file($_FILES["userfile"]["tmp_name"],$newpath);
echo "Fails veiksmīgi pievienots. Paldies!";
}
else
{
echo mysql_error();
}

 

If file is < than 1.90 MB, everything echoes fine, but when it's >- 1.90 MB then it's supposed to show why query can't be executed, but it doesn't.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...