简体   繁体   English

使用PHP上传非常大的图像

[英]Uploading very large images with PHP

I am trying to develop a PHP site in which the user will be able to upload images to a server. 我正在尝试开发一个PHP网站,用户可以在其中将图像上传到服务器。 I am pretty sure PHP has a max upload size of 10 MB. 我很确定PHP的最大上传大小为10 MB。 Problem is, some of the images may be as large as 2-4 GB. 问题是,某些图像可能最大为2-4 GB。 What do you think my best option is for doing this? 您认为我的最佳选择是什么? FTP? FTP? I am looking for the easiest solution possible. 我正在寻找最简单的解决方案。 Thank you. 谢谢。

The easiest solution would be not to use a direct PHP process in this in any way (preferably). 最简单的解决方案是不以任何方式(最好)使用直接的PHP流程。 Note however that the max_upload_size can be changed, it's juat a safety precaution. 但是请注意,可以更改max_upload_size,这是一项安全预防措施。

uploading-a-file-larger-than-2gb-using-php should help you get this answered better though 上传一个大于2gb的文件大于php应该可以帮助您更好地得到答案

Just Create .htaccess file in your project root. 只需在项目根目录中创建.htaccess文件即可。

and paste this code. 并粘贴此代码。

php_value upload_max_filesize 4G

php_value post_max_size 4G

php_value max_execution_time 2000

php_value max_input_time 2000

Hope it will work for you. 希望它对您有用。

Thanks. 谢谢。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM