Jump to content

File uploading taking up large amounts of memory


mschrank99

Recommended Posts

For some reason, uploads are taking up much more memory than the actual file size. For example, I tried to upload a 640K jpg and I set a memory limit per script of 12MB, and that file made the script go over the limit and it crashed. ???

Why are file uploads of 640KB making my script use up more than the 12 meg limit and crash? Is there any way to fix this, short of restricting the file size people can upload?

-Matthew
I don't know why, but I had the same problem, it's possibly a memory leak issue.

Add the following to the top of your page:

[code]
<?php
ini_set("memory_limit", "50M");
ini_set("max_execution_time", "120");
?>
[/code]

Regards
Huggie
Yes, but if I set the memory to 50M, wouldn't it crash my server (or at least bring it to its knees) if more than a few people were using it at the same time?

But in any case, it's not normal for a 512kb file to hog up over 12 megs of ram right?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.