Re: Upload a file into DB
- From: Andy Hassall <andy@xxxxxxxxxxx>
- Date: Thu, 29 Jun 2006 22:04:55 +0100
On 29 Jun 2006 02:54:36 -0700, "yonthebeach@xxxxxxxxxxxxxx"
<yonthebeach@xxxxxxxxxxxxxx> 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@xxxxxxxxxxx :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
.
- References:
- Upload a file into DB
- From: yonthebeach@xxxxxxxxxxxxxx
- Upload a file into DB
- Prev by Date: Re: Change HTML
- Next by Date: Re: Upload a file into DB
- Previous by thread: Re: Upload a file into DB
- Next by thread: Creating pics on the web
- Index(es):
Relevant Pages
|