iZAP Videos upload on-site upload of mp4 giving error Form is missing __token or __ts fields

Video upload is giving me an error Form is missing __token or __ts fields

The percentage counter goes up to 100% and then this message appears.

I am using Elgg 1.8-1.12 & 2.X & 3.X: iZAP Videos - revised edition by iionly version 3.3.2

Elgg version is 3.3.10

I have checked the obvious, ReWrite Rules in .htaccess etc.

Any clues please?

  • Looks like this could be file size related?, but I have set upload_max_filesize correctly in both /etc/php.ini and .htaccess however when I look at phpinfo it still states a 2MB limit even after restarting everything.

    <IfModule mod_php7.c>
            # If using PHP 7.x

            # post_max_size is the maximum size of ALL the data that is POST'ed to php at a time (260 MB)
            php_value post_max_size 260M
            # upload_max_filesize is the maximum size of a single uploaded file (128 MB)
            php_value upload_max_filesize 128M
            # on development servers, set to 1 to display errors. Set to 0 on production servers.
            php_value display_errors 0

    So I still can't use the ONSERVER video upload for any decent size videos




  • What values for the php variables are shown in the admin area of your site ("Information" - "Server" section on PHP tab) and/or on the "Server analysis" tab of the iZAP Videos plugin settings page?

    The analysis tab of the iZAP Videos plugin should display all relevant variables. The values displayed there should be the values also in effect when processing uploaded videos.

    For a start (and to find out if any limits might cause the problem) I suggest to test it by uploading a very small videos. For example, the video included in the server_test subfolder within the iZAP Videos plugin folder could be used.

    I'm not fully convinced the problem is with php variables though. The error message would indicate that the upload action call could not be authenticated correctly. But this authentification should be within the code of the IZAP Videos plugin for sure. So, the question is if maybe some other plugin interferes (so, another test could be to test with all other 3rd party plugins temporarily disabled).

    Or does the analysis tab displays any other issues? There should be only successes shown. Otherwise, some component is missing on the server or is not correctly configured.

  • The variables in the Server information are also the default, they just don't appear to change whatever I do with php.ini or .htaccess. I also had an error uploading a smaller video, this gave a different error. I will do what you suggest and disable all other plugins and see if we have interference as I have installed other plugins after the video plugin, thank you for your assistance.

    PHP version 7.2.24
    PHP ini file location /etc/php.ini
    PHP Log /var/log/php-fpm/www-error.log
    Memory available 134,217,728
    POST maximum size 8,388,608
    Upload maximum size 2,097,152 
  • Seeing the path in the PHP log line I think you are running PHP as FastCGI module (php-fpm). In this case you can't set PHP variables via .htaccess files. The values set there are simply ignored. And maybe the php.ini file location as displayed by Elgg (/etc/php.ini) is also not the php.ini actually used by php-fpm! You would need to figure out if there might be another php.ini (e.g. /etc/php7/fpm/php.ini - or at some other location) where you could configure the limits used by PHP, Elgg and iZAP Videos.

    What was the different error when uploading the smaller video? Maybe there's a second issue apart from setting the PHP variable values to larger values.

  • You are an absolute star for spotting that sir!

    The config file is in /etc/php-fpm.d/www.conf

    I set the following: php_admin_value[memory_limit] = 200M

    and now i get below, I will check the uploads large and small again and report back, thank you so much for your kind help

    PHP version 7.2.24
    PHP ini file location /etc/php.ini
    PHP Log /var/log/php-fpm/www-error.log
    Memory available 209,715,200
    POST maximum size 209,715,200
    Upload maximum size 104,857,600 
  • I spoke too soon, I tried to upload a 20MB video and got the error the provided file is larger than the maximum allowed size. :-( at least that is an error from the plugin this time.

  • The iZAP Videos plugin also has a maxsize limit for uploads that you can configure on its plugin page (default is 5MB). This separate limit is to allow for setting a smaller limit for video uploads in case you need to allow larger uploads of other files (e.g. with the bundles Files plugin). So, you would have to increase the limit on the iZAP Videos plugin settings page and try again.

    Nonetheless, I would suggest to test also with a smaller video file if the upload/processing fails. If it works for a small file but not for a large file the problem is likely some limit. If small video files fail also, there's likely some mis-configuration on the server (e.g. iZAP VIdeo plugin settings options or ffmpeg configuration on server).

  • I hadn't gone back to the plugin settings and changed that (thank you), I've done that now and the video has uploaded, I tried a small one and the 25MB one and both uploaded.

    The video reported as converted successfully, however I get audio only. I tried a CLI conversion with ffmpeg and the outfile file is fine, it just doesn't render through the site. I am just using the basic command /usr/local/bin/ffmpeg -y -i [inputVideoPath] [outputVideoPath] so I may need to play around with that maybe?

  • OK, so I got it working, seems like the version of ffmpeg I installed didn't have the libx264 codec which is required for HTML5. So I recompiled with the configure option to include.

    convert command now :

    /usr/bin/ffmpeg -y -i [inputVideoPath] -vcodec libx264 -acodec aac [outputVideoPath]


    /usr/bin/ffmpeg -y -i [inputVideoPath] -vframes 1 -ss 00:00:10  -s 320x240 [outputImage]

    Just uploaded 100MB video and all good

    Thank you @iionly for you patience and superb assistance on this matter