【问题标题】:php + upload.class + not overwriting the imagephp + upload.class + 不覆盖图片
【发布时间】:2011-01-28 18:51:11
【问题描述】:

我正在尝试使用 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; 谢谢

我解决了这个问题...抱歉浪费你的时间

【问题讨论】:

  • 这是一个自定义类,如果没有更多代码,没有人能够提供更多信息。但会不会是你只是拼错了code_overwrite?缺少一个r

标签: php upload overwrite


【解决方案1】:

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2014-08-05
    • 1970-01-01
    • 1970-01-01
    • 2012-11-21
    • 2010-11-14
    • 1970-01-01
    • 2016-09-26
    • 2011-12-18
    相关资源
    最近更新 更多