By kidd1126 on
I have a question that, currently, I have a node form which has a image field build by cck, and the node type name is test.
When click the link "...node/add/test?id=12345", I will catch the id and use jsonp to get the value.(the defuault value for this form are the results of the jsonp call). eg: I get the title value and I set it as the default value.
But the question how about the image field? I can download the image to my server, but how can I set the image field defautl value?
I want the image is already there just like when edit it.
thank u very much if u can help me !
Comments
Maybe I am missing something,
Maybe I am missing something, but you can configure the image field with a default image.
thank u for your reply i have found the way to do it
use a form alter hook and add the code like below, specify the fid that will work.
so what i should do is download the image and insert a record in the drupal files table
code:
form['#node']->field_app_thumbnail[0] = array(
// specify fid
'fid' => 6,
);