English 中文(简体)
Php 上传类问题, 文件在 6Mb 以上
原标题:Php Upload Class issue with file over 6Mb

我正在制作一张相册, 用户可以在其中上传自己的图片。 我希望用户能够将任何大小的图片发送到网站, 如果超过 5Mb, 它会被处理到 5Mb 上传类的 php 上传类 5Mb 。

文件的上传工作用于小于位于 30Mb 的php.ini 文件中配置大小的任何图片。 原始图片会被上传到临时文件夹, 以便处理 。

我很容易处理图片来创建拇指和主图片,但当我想生成大文件(处理为5Mb供用户下载)时,它不起作用。

以下是我用来处理图片的代码:

$handle = new upload("../".$path_picture_temp.$this->imgName);

    if ($handle->uploaded) {
      $handle->image_convert         =  jpg ;
      $handle->jpeg_size             = 5242880;
      $handle->process("../".$path_picture_full);
    }
    if ($handle->uploaded) {
      $handle->image_resize         = true;
      $handle->image_x              = 231;
      $handle->image_y              = 153;
      $handle->image_ratio_crop     = true;
      $handle->image_convert        =  jpg ;
      $handle->jpeg_quality         = 95;
      $handle->process("../".$path_picture_thumb);
    }
    if ($handle->uploaded) {
      $handle->image_resize         = true;
      $handle->image_x              = 1000;
      $handle->image_y              = 1000;
      $handle->image_ratio          = true;
      $handle->image_convert        =  jpg ;
      $handle->jpeg_quality         = 95;
      $handle->process("../".$path_picture_main);
    }

当我在 6Mb 下上传图片时, 它即使缓慢也有效, 但是如果我在 6Mb 上传图片, 它不起作用, 它甚至不处理任何东西 。

当我坐上处理大图的第一部分时,文件大小都很好。有人知道为什么会发生这种情况吗?

问题回答

If you are using GD and imagcreatefromjpeg() function, this maybe will solve your problem: PHP GD imagecreatefromjpeg cant handle big size image?





相关问题
Brute-force/DoS prevention in PHP [closed]

I am trying to write a script to prevent brute-force login attempts in a website I m building. The logic goes something like this: User sends login information. Check if username and password is ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

定值美元

如何确认来自正确来源的数字。

Generating a drop down list of timezones with PHP

Most sites need some way to show the dates on the site in the users preferred timezone. Below are two lists that I found and then one method using the built in PHP DateTime class in PHP 5. I need ...

Text as watermarking in PHP

I want to create text as a watermark for an image. the water mark should have the following properties front: Impact color: white opacity: 31% Font style: regular, bold Bevel and Emboss size: 30 ...

How does php cast boolean variables?

How does php cast boolean variables? I was trying to save a boolean value to an array: $result["Users"]["is_login"] = true; but when I use debug the is_login value is blank. and when I do ...

热门标签