form is missing __token or __ts fields on mp3 upload

I am using elgg 1.7 and whenever I attempt to upload an mp3 through the files plugin I get this error. Images upload ok as well as documents, I tried upgrading to 1.7.1 and this did not resolve the issue. Other plugins designed to upload audio specifically have the same error, any ideas?

  • Hey Jimmy,

    Are you using a 3rd party or custom upload form?  If so check out for how to add security tokens.  It's usually a one- or two-line fix.

  • It happens with the core files plugin, but only with the MP3 files, I also tried webgalli and got the same issue. If I didnt get an upload error from an image or document upload is there a reason a token wouldnt be submitted when the file is an MP3?


  • Cool, 1.7.1 is working now with the core files plugin im not sure what the issue was, thanks for the feedback though this may have just been something with 1.7 or something I did :)

  • same issue here :(

    Elgg gives no music for me :(

    HaPPy ElGGInG

    Do GooD :)

  • Actually no, this appears to be a matter of file size. Is this capped and if so what is the limit? I got an extremely small mp3 to take. Even so weird it would return a form error in the event of an oversized file. Weird, still picking at it.

  • It sounds like PHP's max post size might be too small, so the tokens are getting cropped off.  There does need to be better checking in the file mod for large files, and the form should probably send tokens first instead of after the file.  That warning is a red herring.

    There are a few things you'll want to check in your PHP settings: post_max_size, upload_max_filesize, and memory_limit.  Make sure these have largish and sane values.  (ie, post_max_size is >= upload_max_filesize).

    Hope this helps...

  • Hey Brett,

    Yeah I tried editing these didn't seem to resolve, the included limits already in the file were not exceeded I may need to play around some more I hope I can find the culprit.



  • Still hung up on this if anyone has any ideas, I tried increasing all of these:

     post_max_size, upload_max_filesize, and memory_limit.  Make sure these have largish and sane values.  (ie, post_max_size is >= upload_max_filesize).

    I didn't see any PHP errors in my logs upon upload failure, really stumped any additional insight would help if possible.

  • The trouble is that PHP clears out $_POST when a file is too large compared to post_max_size. Elgg would need to scrouge around in php://input for the token and timestamp.

  • Hey Cash,

    Thanks for the feedback, the issue is my post_max_size greatly exceeds that of the MP3s I am uploading.