Hi,

Here comes the dumb question: Once you get it into the BLOB field of  
the DB How do you get back out to view or use it? Do you write a  
query to to select the record then write the BLOB back to a file on  
the server and manipulate the newly created file?

Mike
-- 
Mike Brandonisio          *    Web Hosting
Tech One Illustration     *    Internet Marketing
tel (630) 759-9283        *    e-Commerce
[EMAIL PROTECTED]    *    http://www.jikometrix.net

     JIKOmetrix - Reliable web hosting


On Sep 9, 2005, at 4:24 AM, David Smyth wrote:

> 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
>
>
>
>
>
>
>
>
>
>



------------------------ Yahoo! Groups Sponsor --------------------~--> 
Get Bzzzy! (real tools to help you find a job). Welcome to the Sweet Life.
http://us.click.yahoo.com/A77XvD/vlQLAA/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/
 


Reply via email to