Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+1 vote
868 views
in Q2A Core by
As far as I can see the only "option" to enable/disable file uploads to the server instead the DB is setting the qa-config.php variable QA_BLOBS_DIRECTORY.

I am very sure that new users of the q2a script will not find this information, nor do not expect this kind of "switch".

So my suggestion is:

1. Make an admin section for the file upload handling.

2. If possible: Make the path an opt() entry.

3. Provide an option (opt) for qa_upload_files_to_db 0 or 1.

From this option the server should decide if uploading to Server or DB, see app/blobs.php
Q2A version: 1.7.2

1 Answer

+1 vote
by

I understand what you mean, when I was fixing the other issues you brought up I also thought there was an admin option for file handling!

1. What do you mean here? A page that lists all file uploads, and you can update/delete them for example?

2. I don't think this is feasible because the path is likely to be dynamic, i.e. based on $_SERVER['DOCUMENT_ROOT']. With an admin option you'd need to add '/var/www/sitename' or something, which isn't flexible if you switch servers or make other server changes.

3. Yes, this makes sense. I also realised there was a potential issue if you switch to using file storage but don't migrate the DB yet. You'd have some files in the DB and some on disk, but there is only one button in the admin, to move all files to disk. If you decide you want to use the DB you have to move the DB files to disk, then move back to the database, then remove the QA_BLOBS_DIRECTORY variable.

by
> 1. Make an admin section for the file upload handling.
A certain area in the admin panel where you can set all the necessary options.

2. True, that was probably the reason why Gideon chose this way.

3. Goes together with point 1.

And in the admin section, you can explicitly tell the admin user, you need to edit qa_config.php and set the path ... Then it is super clear and everybody will know what to do.
...