Re: Upload a file into DB



PHP already provides the OS independence.

It is better practice to store a link in the DB and the file in the
file system.

Accessing the file is also faster, as it doesn't have to go through the
database.

Backing up shouldn't be an issue. Backups should be done by scripts,
at the most you should only have to click a button or run a command to
perform a back up.

yonthebeach@xxxxxxxxxxxxxx wrote:
realmehmet wrote:
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? And how to check for a max filesize (max. 1MB) and if its
bigger cancel operation.
Why don't you upload the file to some folder and then insert link of it
to DB?

Mehmet Zahit Ates

to be os independent and easier backup of the running app.

greets
yavuz bogazci

.


Quantcast