Forums

Unable to Upload Images to BLOB field in database (Plain form created directly using PHP is working fine)

prashanth.sp.rao956 04 Aug, 2024

I have created a simple form that contains three fields.

  1. name
  2. email
  3. photo

Photo is a blob field in DB and would like to store the images into this database field.

I have double checked the permissions to write to /tmp/ folder. Its fine.

Joomla Global Config is set correctly to /tmp/ folder

With debug info ON, I see this info on the webpage when a file is uploaded.

Array
(
    [photo] => Array
        (
            [name] => BestPrice - Copy.jpg
            [full_path] => BestPrice - Copy.jpg
            [type] => image/jpeg
            [tmp_name] => /tmp/php1SCniu
            [error] => 0
            [size] => 15815
        )

)
upload_max_filesize: 2048Mupload_tmp_dir: SMTP: localhostsmtp_port: 25memory_limit: 2048Mpost_max_size: 2048Mmax_execution_time: 360

FILE element is configured in the form as shown below.

I have tried to write the Custom PHP code in submit to convert the file data into a stream so I can upload to DB.

But this PHP is not able to access the temp file since temp file is not written as part of Chronoform processing.

Can you let me know how can I accomplish this need of uploading a file to database.

Note: I have written a plain PHP form with db processing and is able to upload the file to database. No issue. With Chronoforms 8, I am not able to do it.

Looking forward for your support.

Thanks,

Prashanth

You need to login to be able to post a reply.