Upload image to database

Hello everyone,

I am working in php web application
this application will let users some files (photos, and pdf)

which is the best way to upload files?
Upload the file to the server with “move_uploaded_file” ? or decode the file to base64? or another way that you may recommend to me.

Note: I have to limit file size no more that 2MB, because it will be a large web application,

Note: I have to limit file size no more that 2MB, because it will be a large web application,
That actually makes little difference.

I recommend moving the files behind a public root and having a database for determining where the file is located. It gives access control to the file.

Sponsor our Newsletter | Privacy Policy | Terms of Service