使用copy()将timthumb输出保存到服务器


saving timthumb output to the server using copy()

当前我正在将文件上传到服务器。一旦上传了一个文件,我就可以调整大小并复制到另一个位置。

copy(timthumb_image_address, new_server_address);

到目前为止,这一直运行得很好。Timthumb运行良好,但我无法将其正确复制到服务器。我现在制作无效文件。

保存文件的文件夹是可写的。我实际上可以进去下载它。但我不能在下载时查看图像本身,也不能在浏览器中查看

没有错误消息

以下是我一直在使用的一些伪地址

copy()第1部分:

http://mywebsite.com/timthumb.php?src=/home/usernamehere/public_html/images/uploads/imagetocopy.jpg&w=32&h=32

copy()第2部分:

/home/usernamehe/public_html/images/uploads/imagetocopy_v2.jpg

它制作了一个533字节大小的文件。不管怎样,这始终是我在filezilla中看到的大小。

我知道它是无效图像的唯一方法是因为没有什么能打开它。而皮卡莎说它是无效的图像。尽管有.jpg的扩展名。

有什么想法吗?

好吧,我想我解决了它。我想这是因为我使用了apache密码保护。文件本身有一个401错误消息

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>401 Authorization Required</title>
</head><body>
<h1>Authorization Required</h1>
<p>This server could not verify that you
are authorized to access the document
requested.  Either you supplied the wrong
credentials (e.g., bad password), or your
browser doesn't understand how to supply
the credentials required.</p>
<p>Additionally, a 401 Authorization Required
error was encountered while trying to use an ErrorDocument to handle the request.</p>
</body></html>