I need create node from script with CCK field:

Field name:field_thumbnail_image
Field type:File
Widget type: Image

Script:
......
$node->uid = '1';
$node->field_teaser = array(array('value' => $teaser_sw));
$node->field_thumbnail_image = array(array('value' => $thumbnail_image_sw));
$node->title = $title_sw;
$node->created = $created_sw;
$node->status = 1;
$node->promote = 0;
$node->sticky = 0;
$node->body = $body_sw;
$node->type = 'trailer';
node_save($node);

if i put to variable $thumbnail_image_sw = "http://www.xy.com/pathtofield/namefield.jpg" file is not uploaded.
How is possible to upload CCK File Image. I think there is a API that simulate click on Upload button.