2011-08-11 47 views
0

我一直在嘗試像兩天,每次我上傳圖像,在數據庫中,我在頭像列中得到空,它甚至沒有上傳! 我使用symfony的1.4我都sfdoctrineguard和sfforkeddoctrineapplyplugin(我認爲這是問題,因爲我記得當我第一次使用它上傳工作之前開工的項目)與symfony上傳頭像始終爲空

我正在使用的代碼在本教程:

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) 

我的分身屬性爲照片!

所以任何想法如何解決這個問題? 順便說一句,我試圖正常Jobeet的1.4教程使用簡單sfwidgetforminputfile上傳,並沒有工作:( 也是我做了我的照片文件夾777和我做了www數據它的主人!

+0

我不知道是否有幫助,但: $ this-> form-> getValue('photo'); $ request-> getFiles($ this-> form-> getName())是空的! – Ray

回答

0

我可能已經找到了解決辦法,但我不知道我還需要你的意見!

要麼柱照片添加到表sfGuardUser並嵌入與中庸之道形式的照片我registerform

或者創建擁有關係1新表照片到1與sfGuardUser,並將其嵌入我的註冊,但這會產生一些額外的疑問,我想!在這裏,我也絕對不知道我可以如何做一些提示或鏈接可以幫助我很多在這裏!

thx提前!