【发布时间】:2013-04-10 08:17:42
【问题描述】:
我正在使用jquery file upload 脚本,并已成功将主图像上传到 Amazon S3。我现在正在尝试交换多个图像大小以上传到 S3 中的子文件夹或对象。
在 UploadHandler.php 文件中的 create_scaled_image 函数中如何替换 带有 S3 调用的 imagecopyresampled 调用?这甚至可能吗?
这是调整图像大小并将文件写入的内容:
$success = $src_img && @imagecopyresampled(
$new_img,
$src_img,
$dst_x,
$dst_y,
0,
0,
$new_width,
$new_height,
$img_width,
$img_height
) && $write_image($new_img, $new_file_path, $image_quality);
// Free up memory (imagedestroy does not delete files):
@imagedestroy($src_img);
@imagedestroy($new_img);
我能否以某种方式调整内存中的图像大小,然后将文件保存到我的 S3 对象中?
$bucket = "pics.mysite.com";
$file = ??
$uploaded_file = ??
$response = $s3->create_object($bucket, $file, array('fileUpload' => $uploaded_file, 'acl' => AmazonS3::ACL_PUBLIC));
if ($response->isOK()) {
//success
}
【问题讨论】:
标签: php jquery amazon-s3 jquery-file-upload