Topic: php related: uploading

I've working on making file uploads integrated into the topics, and have the big parts done (database stuff). I've managed to write some php to let people download the files (since thier stored in /data/music and the www is in /www/pages) and it flushes every 8MB, so even a 100MB file can be downloaded (in 8MB chunks, into the web server buffers). The problem I'm having is with uploading files that are over 8MB. The uploading is done almost the same way avatar uploading is done (I've changed some checks to reflect different vars, and move locations, but effectivly the same way). I've set the hidden max file tag to 20MB and I've set the php.ini to reflect this:

file_uploads = On
;upload_tmp_dir =
upload_max_filesize = 25M

Anyways, when the browser submits a 10MB file or so, it returns to the form, as if nothing was submitted (not even "submit" is set). But anything under 7MB or so works fine.

Here's the error log entry for this problem:

Allowed memory size of 8388608 bytes exhausted (tried to allocate 2201600 bytes)

In the upload code I don't try to "read the file to a variable" or anything... other then the variables of $_FILES['file'] I don't touch the file till a call to move_uploaded_file.

I was hoping, since we have a few upload experts hanging around, one of them could help me out some big_smile

I'm sure it's something I've forgotten to configure, or a missing lib or php add-on.

echo "deadram"; echo; fortune;

Re: php related: uploading

It's difficult to say. Something is using up a lot of memory. You need to find where the memory is being consumed and take it from there.

"Programming is like sex: one mistake and you have to support it for the rest of your life."

Re: php related: uploading

Isn't that simply the attachment mod though? tongue
Does the error give a line? If so, what's the line?

Re: php related: uploading

there's several variables that affect max upload ... I've mentioned them in the Attachment Mod documentation (as one need to check them to be able to set the max allowed size for the mod)

I've got an 'online version' of the Docs here: http://cms.frankh.shacknet.nu/

Re: php related: uploading

Got it:
upload_max_filesize < post_max_size < memory_limit

I just did 1M extra at each increase

Thanks Frank, and others big_smile

(PS: this isn't ment to be attachment mod, but it's perty close... It's supposed to be "music posts" in such a way that only new topics can have attachments, and replies are about the uploaded songs)

echo "deadram"; echo; fortune;

Re: php related: uploading

That sounds like it would be accomplished more easily as a mod to the mod rather than as a whole new mod tongue