>我正在创建一个PHP文件,其中我正在压缩服务器文件夹中存在的图像(使用php func),并将压缩文件放入另一个文件夹中。 现在的问题是我需要为两个文件夹指定路径,对于源文件夹,我只需给出:
HTTP://ipadrs/images/properties/thumbs_400/image_name (given "http "as HTTP purposely)
我使用fopen
功能检查了文件夹中是否存在图像,并且它工作正常。 我还给出了相同的路径,并在thumbs_400后附加了"/compress_50/",但图像没有在 resp 文件夹中被压缩;相同的 {H{ 文件在本地主机中运行良好。
谁能告诉我为什么会发生这种情况以及解决方案是什么?
编辑:(代码发布在评论中)
$img = HOME."images/properties/thumbs_400/".$sqlrow['plan_image_name']." ";
$handle = fopen($img, "r");
if ($handle) {
$dest = HOME."images/properties/thumbs_400/compress_50/".$sqlrow['plan_image_name']." ";
除非是键入错误,否则请替换:
HTTP//ipadrs/images/properties/thumbs_400/image_name
跟:
http://ipadrs/images/properties/thumbs_400/image_name