The fact is that in general everything works, worked with some files, less and more than 5 MB. Everything worked, the script responded, but then decided to check other files, more than 10mb the script displays what is loaded, why? I checked about 10 files with a size of more than 5 MB, some downloads and some do not. I checked this in chrome, and in mozilla firefox I generally load a file less than 5 MB, the answer is that it is more than 5 MB. What kind of garbage? Here is the handler
if($_FILES['myfile']){ if(file_type($_FILES['myfile']['type']) AND $_FILES['myfile']['size'] < 5242880){ $dir = "../demo/"; $file_name = date("dyHmis"); $file_type = file_type($_FILES['myfile']['type']); if(move_uploaded_file($_FILES['myfile']['tmp_name'], "$dir$file_name$file_type")){ $namemuz = $_FILES['myfile']['name']; $str = substr($namemuz, 0, -4); $direct = "http://mackay.kz/music/demo/"; $urltrack = "$direct$file_name$file_type"; mysql_query("INSERT INTO `mackaykz_music`.`demos` (`namedemo`, `link`) VALUES ('$str', '$urltrack');"); } }else{ echo 'недопустимо'; } }
Here is js
onComplete : function(file, result) { if(result == "недопустимо"){ $("#uploadtrack").text('Загрузка трека'); $("#filemassage").html('Извините, но файл привышает размер 5 мб.'); this.enable(); }else{ $("#uploadtrack").text('Загрузка трека').animate({position: 'relative', top: '-45px'},60); $("#sendermodalwin").fadeIn(50).animate({position: 'relative', top: '-54px'},60); var str = file.substring(0, file.length - 4); $('#namedemostrokes').text(str); $("#filemassage").html('Демка была загружена: <br>' + str +' <br><audio autoplay controls src="' + result +'" ></audio>'); $("#linkdemomain").text(result); this.enable(); } }