This topic is locked

How to upload&save a file to databse?

7/18/2009 3:36:41 AM
PHPRunner General questions
L
ljmjava author

I want to upload a file and save it to database.

Which it is not Blob. I upload a small txt file and the field is Varchar(3000).

How can I do it?

the File/Image is only for Image to database?

L
ljmjava author 7/18/2009

I add a event in beforeAdd:
$values["file_content"]=file_get_contents($_FILES["file_dest_mobile"]["tmp_name"] );
to get the file content and save to database!
file_dest_mobile ----------is the auto generated file field name. Not the db fiield name.
the db field name is "dest_mobile".