0

我已经尝试了两天,每次我上传图片时,在数据库中我的头像列都为空,甚至没有上传!我正在使用 symfony 1.4 我同时拥有 sfdoctrineguard 和 sfforkeddoctrineapplyplugin(我认为这是问题所在,因为我记得我第一次启动项目时才使用它上传工作)

我正在使用本教程中的代码:

http://blog.firehist.org/2010/02/21/symfony-upload-dimage-sans-dupliquer-les-fichiers/

我想我和这个人有同样的问题:

http://oldforum.symfony-project.org/index.php/m/88206/

有人使用 sfforkedappluplugin 成功上传了头像吗?

这是我的用户架构:

User:
  inheritance:
    type: column_aggregation
    extends: sfGuardUserProfile
  columns:
    sexe:
      type: string(1)
      notnull: true
    birthday:
      type: timestamp
    photo:
      type: string(255)
    thumbnail:
      type: string(255)
    mobile:
      type: string(50)
      notnull: true
      unique: true
    address:
      type: string(255)
      notnull: true
    ip_inscription:
      type: string(32)
    is_online:
      type: boolean
      default: 0
    status:
      type: string(255)
    aboutme:
      type: string(255)

我的头像属性是照片!

那么有什么想法可以解决这个问题吗?顺便说一句,我尝试了使用简单的 sfwidgetforminputfile 上传的普通 jobeet 1.4 教程,但它没有用 :( 我也将照片文件夹设为 777,并将 www-data 设为其所有者!

4

1 回答 1

0

我可能已经找到了解决方案,但我不确定我是否仍然需要您的意见!

或者将列照片添加到表 sfGuardUser 中,然后他们在我的注册表单中嵌入一个带有照片的表单

或使用 sfGuardUser 创建具有 1 对 1 关系的新桌子照片,并将其嵌入到我的寄存器中,但这会产生一些我认为的额外查询!在这里我也完全不知道我该怎么做,一些提示或链接可能对我有很大帮助!

提前谢谢!

于 2011-08-11T19:55:16.150 回答