|
Posted by Andy Hassall on 06/29/06 21:04
On 29 Jun 2006 02:54:36 -0700, "yonthebeach@googlemail.com"
<yonthebeach@googlemail.com> wrote:
>how can i upload a file with PHP into my database, and allow a download
>of the file on the frontend (sent to client). Do i upload then into a
>BLOB field?
Yes, BLOB is the usual name for the appropriate data type. But it depends on
what database you're using.
For downloads you either stream it out as the results of a query, or you write
it to a file and let the webserver serve that file, using the filesystem as a
cache, but keeping the database as the master, so you only need to backup the
database and not the filesystem copy.
>And how to check for a max filesize (max. 1MB) and if its
>bigger cancel operation.
http://uk.php.net/manual/en/features.file-upload.php
--
Andy Hassall :: andy@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
[Back to original message]
|