upload a image code?

pls tellme way to upload a file to data base or relevant example code
without using any plugin like act_as_attachment
xxmithila