First, see this thread on this topic:
http://p2p.wrox.com/topic.asp?TOPIC_ID=9504
You may do multiple file uploads, but you'll want to check two configuration directives in php.ini:
1.) upload_max_filesize (2MB by default)
2.) post_max_size (8MB by default)
A database isn't the ideal place for large files anyway, think very small, be very careful with resource consumption!
To initiate download of a file, make your SELECT query and then do the following:
<?php
// query stuff
header('Content-Type:
MIME TYPE HERE'
);
header('Content-Disposition: attachment; filename=
proposed file name here');
// Output file contents
echo $file;
?>
The MIME type of a file e.g. image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/vnd.ms-powerpoint, application/vnd.ms-excel, application/msword, application/x-shockwave-flash...
The proposed file name is what the user will be presented to save the file as.
If you want to view the file and the file is renderable in a browser.. either include a link to the script directly or call on the script in the 'src' attribute of relevant tags and omit the 'Content-Disposition' header call. You can use frames or iframes to view multiple files.
echo "<img src='file.php?id=$id' />";
echo "<iframe src='file.php?id=$id'></iframe>";
etc..
Also see:
http://www.php.net/manual/en/feature...ad.post-method
: )
Rich
:::::::::::::::::::::::::::::::::
Smiling Souls
http://www.smilingsouls.net
:::::::::::::::::::::::::::::::::