Support » Plugin: Contact Form DB » Why are file uploads stored in the database?

  • I’m working with a friend on trying to get a website done for a client and the problems we’re having are coming from the fact it’s trying to store the file contents in the database.

    My question is Why are you storing the file’s contents in the database and not just linking to the upload folder?

    I NULLED the file contents value in CF7DBPlugin.php but then the file isn’t linked anymore and since there’s 43 individual PHP files for this plugin, it’s a mess to try to sort through all of the code and figure out the flow of this plugin.

    So the first question to fixing this would be to figure out why you are storing the contents in the DB and not just linking to the upload directory instead….

    Thanks.

Viewing 1 replies (of 1 total)
  • Plugin Author Michael Simpson

    (@msimpson)

    The file is not linked at the end because CF7 (not this plugin) deletes the files after all the submission actions are taken (mailing, and calling hooks like the one my plugin uses). So that is why the files get stored before they are deleted. And I think the files are uploaded to the temp dir so one can’t rely on them sticking around even if they weren’t. If you want to keep the files in the filesystem, the best thing to do is to write some code to move them where you want them, then maybe change the form field entry to be a URL to them if you like.

    I find your characterization of the files as “a mess” (not to mention your general tone) objectionable. There are so many files to make the code more organized and only load what is needed, instead of having one monolithic mess.

Viewing 1 replies (of 1 total)
  • The topic ‘Why are file uploads stored in the database?’ is closed to new replies.