Look at qa-app-blobs.php and its documentation here.
In my plugin I use this code to write images to the database :
//require_once '../../qa-include/qa-base.php'; require_once '../../qa-include/qa-app-blobs.php'; $p = $_POST; $allowedTypes = array(IMAGETYPE_PNG, IMAGETYPE_JPEG, IMAGETYPE_GIF); $id=0; foreach($_FILES as $f) { $detectedType = exif_imagetype($f['tmp_name']); if(in_array($detectedType, $allowedTypes)){ $pi = pathinfo($f['name']); $name = $f['tmp_name']; $ext = $pi['extension']; //move_uploaded_file($f['tmp_name'], ''); if (qa_write_blob_file($id++, file_get_contents($name), $ext)) echo qa_get_blob_url($id,true); else echo "error"; } }
Welcome to the Q&A site for Question2Answer.
If you have a question about Q2A, please ask here, in English.
To report a bug, please create a new issue on Github or ask a question here with the bug tag.
If you just want to try Q2A, please use the demo site.