JQuery Ajax PHP - download audio / video files

The problem is loading audio / video files using jquery ajax with php. The same script is capable of loading an image file, but does not work for audio / video files.

Environment - WAMP server, audio file size - 8 MB, video - 25 MB.

Script

  • JQuery AJAX code.

    jq.ajax ({ type: "post", url: "test.php", data: new FormData(jq("#form")[0]), contentType: false, cache: false, processData: false, async: false, beforeSend: function() { jq(".msg").html("<img src='wait.gif'>"); }, success: function(response) { jq(".msg").html(response); }, complete: function() { jq("#form")[0].reset(); }, }); 
  • PHP code (test.php).

    print_r ($ _ REQUEST);

In this file form, the values ​​are not displayed when downloading audio files (mp3, etc.) / video (wmv, etc.).

Questions . Please let me know what might cause the problem. Please correct, suggest and help me solve the problem.

+6
source share
1 answer

Update the restrictions (according to how large the file you want to load for support) in the php.ini file for:

post_max_size, upload_max_size

0
source

Source: https://habr.com/ru/post/984535/


All Articles