What, if any, errors are you seeing? Do you have error_reporting activated and set to E_ALL?
A few things to point out:
$upfile = 'C:\uploads/'.$userfile_name;
Your slashes are inconsistent here. Both should be backslashes. Most PHP'ers write Windows paths like this:
'C:\\uploads\\'.$userfile_name;
But I don't think the slashes /have/ to be escaped.
Why do you move the file, open the file and then write the file again? Any operations that need to be preformed on the file can be done all at once before its moved to the destination directory.
I wrote a couple of upload tutorials a while back, have a read of those here:
http://p2p.wrox.com/topic.asp?TOPIC_ID=12104
http://p2p.wrox.com/topic.asp?TOPIC_ID=11883
Also does the file appear in the destination directory on upload? You may also have a problem with permissions. I wrote a tutorial for that as well...
http://p2p.wrox.com/topic.asp?TOPIC_ID=11962
Better to reference this via HTTP instead of the local file system.
file:///C:\uploads/<?php echo $userfile_name ?>
Let us know how it works out!
HTH!
Regards,
Rich
::::::::::::::::::::::::::::::::::::::::::
The Spicy Peanut Project
http://www.spicypeanut.net
::::::::::::::::::::::::::::::::::::::::::