php + upload.class +不覆盖图像

发布于 2024-08-25 17:20:52 字数 698 浏览 8 评论 0原文

我正在尝试使用 upload.class 上传文件,当用户上传新文件时我需要覆盖该文件。但他没有覆盖,而是放入了 photo_01、photo_02 等...... 代码:

        $foto = new Upload($_FILES['photo']);
        $fotot = new Upload($_FILES['photo']);
        $fotot->image_resize = true;
        $fotot->image_y = 110;
        $fotot->image_x = 110;

        $foto->file_new_name_body = "photo";
        $fotot->file_new_name_body = "photo";
        $foto->file_overwrite = true;
        $fotot->file_overwrite = true;
        $fotot->Process("{$dir_fotos}thumbs/");
        $foto->Process("{$dir_fotos}");

有人已经通过了这个或者有解决方案???请注意,我正在使用 file_ovewrite = true; 谢谢

,我解决了问题...抱歉耽误您的时间

i am trying to upload a file with upload.class and i need to overwrite the file when the user upload a new one. But instead of overwriting, he is putting photo_01, photo_02, etc...
The code:

        $foto = new Upload($_FILES['photo']);
        $fotot = new Upload($_FILES['photo']);
        $fotot->image_resize = true;
        $fotot->image_y = 110;
        $fotot->image_x = 110;

        $foto->file_new_name_body = "photo";
        $fotot->file_new_name_body = "photo";
        $foto->file_overwrite = true;
        $fotot->file_overwrite = true;
        $fotot->Process("{$dir_fotos}thumbs/");
        $foto->Process("{$dir_fotos}");

Somebody has already passed by this or has a solution??? notice that i'm using file_ovewrite = true;
thanks

I solved the problem...sorry spending your time

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

毁虫ゝ 2024-09-01 17:20:52

根据常见问题解答,无需为同一文件实例化该类两次。您只需创建一个瞬间,然后调用进程两次。
请参阅官方常见问题解答页面 - http://www.verot.net/php_class_upload_faq.htm

As per the faq, there is no need to instantiate the class twice for same file. U just create one instant and then call process twice.
refer official faq page - http://www.verot.net/php_class_upload_faq.htm

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文