Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.

Images are uploaded to database and directory? Only upload to directory.

+1 vote
83 views
asked Nov 11, 2017 in Q2A Core by john123
Hi !

Images are being uploaded to database and web directory.

Example : define('QA_BLOBS_DIRECTORY', 'files');//

I tried changing web directory folder permission to 777 or 744 but it does same.

How can i upload images to directory only?

Thanks for your help.
Q2A version: 1.7.5

1 Answer

0 votes
answered Nov 13, 2017 by Scott
Are you sure the content is being stored in the database? When you set Q2A to store files in a directory, it still uses the database to keep records of the files. The only difference is the image data itself is not stored in the database.
commented Nov 13, 2017 by john123
Hi Scott !

You are right. Files are stored in directory and database is keeping the record.  Content column in database says 'null' .

However

If i delete blob tables from database, images remain in directory but disappear from my site.

It means i should keep blob tables and directory files both at same time?

If i keep blob tables for images, would it increase the size of the database too much?

Thanks for your help.
commented Nov 25, 2017 by Scott
How are you deleting the images from the database? There are various PHP functions in Q2A that you can use, I think it’s qa_delete_blob which should delete the file and database row.
...