English 中文(简体)
PHP S3 上传时生成缩略图
原标题:Generate Thumbnail On PHP S3 Upload

我有一个上传图像的 PHP 应用程序。 我使用 S3 PHP 类( http:// undesignd. org.za/2007/10/ 22/ amazon- s3- php- class) 。

能否创建一个较小的缩略图并将其上传到 S3 上? 我搜索了网页, 但找不到任何线索 。

谢谢 谢谢

最佳回答

一旦文件被上传到您的服务器, 您可以随心所欲地使用它。 PHP 将为您提供变量 $_ FILES[ your_ form_ element_ name][ tmp_ name] 中上传文件的临时位置 。

从那里您可以使用 Imagick 调整文件大小, 然后将调整大小的图像上传到 S3 上, 随原图像一起 。

Imagick 有一种 Imagick:: thumbnailImaage () 方法, 非常容易使用 。

More details on PHP file uploads here: http://www.php.net/manual/en/features.file-upload.post-method.php And more info about how to use Imagick here: http://php.net/manual/en/book.imagick.php

问题回答

是的,它有可能, 有很多的图书馆 将调整图像大小 为你服务。

http://www.white-hat-web-design.co.uk/blog/resising-images-with-php/

当您调整图像大小时, 图像会以同样的方式上传 。





相关问题
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 ...