Uploading an avatar with symfony always null

569 Views Asked by At

I have been trying for like two days, everytime i upload an image, in the database i get null in avatar column and it's not even uploaded! i'm using symfony 1.4 i have both sfdoctrineguard and sfforkeddoctrineapplyplugin (i think this is the problem because i remember when i first started the project before using it uploading worked)

i'm using the code in this tutorial :

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

i think i'm having the same problem as this guy :

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

did anyone succeed uploading an avatar using sfforkedappluplugin ?

this is my user schema :

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)

my avatar attribute is photo!

so any ideas how to fix this ? btw i tried the normal jobeet 1.4 tutorial for uploading using the simple sfwidgetforminputfile and it didn't work :( also the i made my photos folder 777 and i made www-data its owner!

1

There are 1 best solutions below

0
On

i may have found the solution but i'm not sure i still need your opinions!

either add the column photo to the table sfGuardUser and them embed a form with juste the photo in my registerform

or create new table photo with relation 1 to 1 with sfGuardUser and also embed it in my register but this will engender some extra queries i think! and here too i have absolutely no idea how i can do that some hints or links may help me alot here!

thx in advance!