Choose your database:
AnySQL
MySQL
MS SQL Server
PostgreSQL
SQLite
Firebird
Oracle
SQL Anywhere
DB2
MaxDB

Subscribe to our news:
Partners

Firebird PHP Generator online Help

Prev Return to chapter overview Next

Uploading files to webserver

There are two ways to store files on a webserver:

1. Store files directly in the database (in BLOB columns).

2. Store files on a disk. Database stores the paths to the files in this case.

 

Uploading files to be stored in a database

To allow the uploading of files and images to a BLOB column, select File Upload or Image Upload at the column's Edit properties and Click the ellipsis button next to Edit properties and set the additional parameters of the uploading.

 

 

To limit the size of uploading files, check the Use file size limitation option and specify the Max file size.

 

To store original names, types, and sizes of the uploaded files, specify the proper columns as File name field, File type field, and File size field respectively. (Optional)

 

For image uploads you can limit the dimensions of uploaded images. For this purpose, check the Use image size limitation options, and set the necessary Max width and Max height.

 

Example

To allow uploading images which size is not greater than 200Kb, width is not greater than 600px and height is not greater than 400px and to save the original file names to the file_name column, specify the Edit properties as follows:

 

 

Uploading files to be stored on a disk

To allow the generated PHP script to upload files to your webserver and save their paths in your database, select Upload file to folder or Upload image to folder at the column's Edit properties and click the ellipsis button next to Edit properties and set the additional parameters of the uploading.

 

 

Specify the folder to upload and names for uploaded files: a random number or a new name composed of original file name, original file extension and the size of original file.

Example:

Suppose we have files:

sqlite_maestro.exe  (14563609 Bytes)

mysql_maestro.exe  (27241901 Bytes)

 

To upload them using the generated PHP script to the data/files/ folder as

sqlite_maestro (14563609).exe

mysql_maestro (27241901).exe

 

Specify the Edit properties as follows:

 



Prev Return to chapter overview Next