Reply to Re: Upload a file into DB

Your name:

Reply:


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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация