Sei in Home page » Prodotti » Opensource » WebGUI » SQLEdit W(eb)Object » Upload file in BLOB

Soluzione integrata di telefonia su internet a banda larga.
Cerca su questo sito:  

Vuoi essere aggiornato in tempo reale su tutto quello che mi succede giorno per giorno?
Visita il mio nuovo blog

Upload file in BLOB.

Starting from 06.02.00, you have the possibility to use your BLOB database fields to store binary files like images, pdf documents, etcetera. This document gives a brief description of how to use this new functionality and some tips to solve some doubts about files upload over HTTP.

To use this new field type, you must have a table with a BLOB field where binary file will be stored. Remember that there are usually four kinds of *BLOB fields:

  • TINYBLOB to store data up to 256 byte
  • BLOB to store data up to 64Kbyte
  • MEDIUMBLOB to store data up to 16Mbyte
  • LARGEBLOB to store data up to 4Gbyte

Then, the most used BLOB will be MEDIUMBLOB.

With this new field type, if you bind an SQLEdit Wobject to a table with a BLOB column, automatically this column will be associated to a FORM file type .

After having upload a file into column, if you edit the record, a link will become visible to allow to delete the attached file. SQLEdit doesn't offer the possibility to show or download the binary file available in a BLOB column. As soon as possible I should develope an external Wobject to view BLOB data in the right way. A solution will be released to integrate this new Wobject with SQLEdit to give a preview/download of the BLOB binary data.

The SQLEdit upload functionality doesn't required a webserver writable directory because the upload stream is directly saved into database without filesystem steps. However you must remember that upload a file over HTTP presupposes some server side configuration above all if you wish to upload large files.

Starting from 06.02.02, you can obtain the filename and content type of the uploaded file. If your upload filed is called "file_upload", and you have two columns, "file_upload_ContentType" and "file_upload_FileName", these columns will be updated automatically with the content type and filename of the uploaded file. If you wish to have more control about this, you can use the onBeforeSave event. As an example, if you wish that the original filename of the uploaded file is stored in a column named "fileName" you can use this script in the OnBeforeSave event:

my $fv = $_[0]->{fld_values};

$fv->{fileName} = $fv->{file_upload_FileName};


It don't require a "file_upload_FileName" column, but only the fileName one, of course :-)

Problem uploading large size file.

If SQLEdit uploads work with small files and not with large files take a look to your server variables.

There is an Apache directive LimitRequestBody that limits the size of the HTTP POST request. As an example, some RedHat versions limit this to 1Mbyte, so, take a look in your Apache configuration files, search this directive and increase its value if required.

Another element that could limit file size upload is the MySQL variable "max_allowed_packet" because it limits the size of SQL statements. As an example, in my server with MySQL 2.23.56, this variable was set to 1Mbyte and so I wasn't able to upload file larger than 600 KByte. So take a look at your MySQL configuration with "mysqladmin -p variables" and increase this variable with you my.cnf configuration file if this variable it to small for your uploads.

JavaScript Menu Courtesy of

Lascia un commento

Nome e Email sono obbligatori (l'email non verrą mostrato). L'URL č opzionale. I commenti non appariranno subito in quanto sono sottoposti a moderazione.

Sono accettati questi TAG: <A>, <STRONG>, <B>, <EM>

1.vivek il 2011-11-15 11:21:54 ha scritto:

good one

 Copyright© 1997-2006 Emiliano Bruni Online dal 16/08/1998 con visitatori Scrivimi all'indirizzo: