Hi Suminth,
I use the code below to do just this. You will require a BLOB data
type field in your database (or LONGBLOB) depending on your file size
requirements.
The code reads the binary content of the file and saves it to the
MYSQL database which is what, I assume, you are after. If you want to
make sure that people just upload word files then you'll need to do
some checking on the fileType variable.
<!--Start code
$file = $_FILES['file']['tmp_name'];
$fileName = $_FILES['file']['name'];
$fileType = $_FILES['file']['type'];
$fileSize = $_FILES['file']['size'];
if ($file){
$data = addslashes(fread(fopen($file, "r"), filesize($file)));
}
mysql_select_db($database_cairncapital, $cairncapital);
$result=mysql_query("INSERT INTO document (title, publishdate, `file`,
fileName, fileType, fileSize, summary) VALUES
('$document_title','$document_date', '$data', '$fileName',
'$fileType', '$fileSize', '$summary')") or die(mysql_error());
-->End Code
Hope this helps, if you need the code to get the file back out of the
database when required then let me know.
David.
--- In [email protected], sumanth kiuumar <[EMAIL PROTECTED]>
wrote:
> Hi friends,
>
> In the project in which i m working has the following requirement.
>
> It is like a CV Registration.
>
> There is a form with the fields like name,age, experience, current
employer, previous employer, salary and upload ur cv.
> In this when the user fills the form and uploads his resume, the
data should be stored in a database including the CV.
>
> Can anyone send me the code so that i can get some idea on how it works
>
>
> ---------------------------------
> Do you Yahoo!?
> The New Yahoo! Movies: Check out the Latest Trailers, Premiere
Photos and full Actor Database.
>
> [Non-text portions of this message have been removed]
------------------------ Yahoo! Groups Sponsor --------------------~-->
Most low income households are not online. Help bridge the digital divide today!
http://us.click.yahoo.com/cd_AJB/QnQLAA/TtwFAA/CefplB/TM
--------------------------------------------------------------------~->
The php_mysql group is dedicated to learn more about the PHP/MySQL web database
possibilities through group learning.
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/php_mysql/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/