$mimg=strtolower(substr($_FILES['video1']['name'], strrpos($_FILES['video1']['name'], '.') + 1));
$ext = $lastid.".".$mimg;
$target_dir = "wp-content/plugins/videos/includes/uploads/".$ext;
$ss=move_uploaded_file($_FILES["video1"]["tmp_name"], $target_dir);
$imageFileType = pathinfo($target_dir,PATHINFO_EXTENSION);
//$ex = $lastid.".".$imageFileType;
if($imageFileType != "mp4" && $imageFileType != "avi" && $imageFileType != "mov" && $imageFileType != "3gp" && $imageFileType != "mkv")
{
echo "File Format Not Suppoted";
}
else
{
if($ss){
$update2=$wpdb->query("update wp_videos set video1='".$ext."' where id='".$lastid."'");
if($update2)
echo "uploaded ";
}
}
回答
你可以做到以下幾點:
ini_set('upload_max_filesize', '15M');
ini_set('post_max_size', '15M');
當我上傳14mb視頻,我得到了一個錯誤 –
警告:POST內容 - 14655593字節的長度超過了第0行的未知8388608字節的限制。 –
我添加了第二行。試試吧。 –
你需要設置的upload_max_filesize
和post_max_size
值在php.ini
upload_max_filesize = 15M
post_max_size = 15M
你需要重新啓動服務器才能使用新的配置。
如果你不能改變你的php.ini,那你的運氣不好。您不能在運行時更改這些值;文件比在php.ini指定的值的上傳將被執行一次都未能達到您到ini_set()
我已在php.ini中更改,但無法在服務器中更新 –
重新啓動您的服務器... –
感謝信息 –
您需要設置的upload_max_filesize和post_max_size要的價值在php.ini或電話的.htaccess:
; Maximum allowed size for uploaded files.
upload_max_filesize = 40M
; Must be greater than or equal to upload_max_filesize
post_max_size = 40M
Simply add this code in your theme’s functions.php file.
@ini_set('upload_max_size' , '64M');
@ini_set('post_max_size', '64M');
@ini_set('max_execution_time', '300');
This code tries to increase upload maximum filesize, post maxiumum size, and maximum execution time limits for your WordPress site. However, this may not work for some WordPress websites.
In that case, you can try adding this code to your .htaccess file in your site’s root folder.
php_value upload_max_filesize 64M
php_value post_max_size 64M
php_value max_execution_time 300
php_value max_input_time 300
If both of these methods fail, then you can try adjusting these values using php.ini file.
Ref: http://www.wpbeginner.com/beginners-guide/how-to-upload-large-images-in-wordpress/
- 1. Tweetinvi沒有上傳的視頻大於15MB
- 2. AWS PHP上傳無法上傳大於15MB的文件
- 3. 在php中的最大視圖(視頻)
- 4. PHP視頻上傳
- 5. PHP上傳視頻
- 6. 視頻上傳和顯示在PHP?
- 7. 視頻上傳在PHP
- 8. 如何在移動div上調整YouTube視頻的大小?
- 9. 如何在laravel中編寫最大視頻上傳大小的驗證
- 10. PHP SOAP服務 - 大於15MB的上傳文件失敗
- 11. YouTube。如何使用PHP上傳視頻
- 12. 在php中壓縮視頻並上傳
- 13. 移動HTML5視頻格式,視頻大小和FPS
- 14. 如何在iPhone SDK中上傳視頻
- 15. 試圖在php中上傳視頻文件,但它太大
- 16. 如何在wordpress/php中調整視頻的移動模式?
- 17. 使用PHP上傳視頻
- 18. Php視頻上傳錯誤
- 19. youtube gdata上傳視頻php
- 20. PHP視頻上傳問題
- 21. PHP的FTP上傳大型視頻文件和目錄創建
- 22. MLT移動視頻上?
- 23. 從移動設備上傳照片和視頻
- 24. 如何在Heroku上上傳大文件(特別是視頻)
- 25. 如何在服務器上上傳大視頻文件?
- 26. 如何在drupal中上傳視頻後播放視頻
- 27. 如何存儲用戶上傳的大量照片和視頻?
- 28. PHP視頻上傳和檢查視頻類型
- 29. 如何上傳視頻?
- 30. Vimeo PHP API如何將我最近上傳的視頻添加到頻道?
通過增加服務器中的上傳大小。搜索如何在php中增加上傳大小。 –
目前還不清楚你實際問了什麼,對不起。很明顯,系統中可能的文件上傳大小受到php的限制,但這些設置都有文檔記錄,你應該沒有問題學習如何改變它。那麼你的問題在這裏呢? – arkascha
你面臨什麼樣的問題?有沒有錯誤信息? –