Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Try Vanilla Forums Cloud product

Post Attachments not showing

pinchiespinchies New
edited July 4 in Vanilla 2.6 Help

Hi all, I'm having problems with attaching files to posts on my site.

  • Uploading images works fine, and they display correctly.
  • Attaching files are uploaded correctly, and I can see them on the server in the uploads folder.
  • But, no attachment is visible in the post after submission.
  • I have enabled the uploading permission for users.
  • No error message is generated.

Any assistance/advice would be appreciated, I'm out of ideas on this one.

Comments

  • What kind of files are you trying to upload? You can add allowed extensions to you conf/config.php:

    $Configuration['Garden']['Upload']['AllowedFileExtensions'] = array('txt', 'jpg', 'gif', 'psd', 'png');
    

    Also you are using both button bar and editor. You can disable button bar as it is superseded by the editor plugin.

    My themes: pure | minusbaseline - My plugins: CSSedit | HTMLedit | InfiniteScroll | BirthdayModule | [all] - PM me about customizations

    pinchies
  • pinchiespinchies New
    edited August 11

    Thanks, I checked that I have enabled the file types I want. I have also disabled the button bar plugin, but the problem remains. Even when I upload any non-image type, I do not see any attachment below the post after submitting the post. Any other suggestions?

  • I did a bit of poking, and I checked my database, and the "Media" table is completely empty - so it seems the attachments are not being successfully saved into the database after uploading?

  • The other clue I have, is that in the permissions list, I only have upload, I don't have download visible in the list:

    Apparently there is supposed to be two permissions?
    https://blog.vanillaforums.com/product/how-to-use-file-upload

  • After spending hours debugging the ENTIRE system, I finally found the cause, and fixed it.

  • whu606whu606 I'm not a SuperHero; I just like wearing tights... Moderator

    @pinchies

    It is considered polite to provide the solution when you answer your own question, to help others in the future.

  • @whu606 said:
    @pinchies

    It is considered polite to provide the solution when you answer your own question, to help others in the future.

    Cheers... I was planning to, just not at 3:30am...

    PROBLEM:
    The solution was a database table structure issue. For some reason I had “StorageMethod” as a mandatory column in the Media table.

    SOLUTION:
    Removing “StorageMethod” from the structure of table “Media” fixed the issue.

    CAUSE
    It seems at some point there was support for uploading files to Amazon S3, but this was pulled or removed at some point. I don’t know how my database structure ended stuffed, but now I am still wondering if there are other database issues with my install too.

    Frustratingly, I couldn’t find any documentation about this. I couldn’t find an overview of the standard vanilla forum database layout, nor any overview of the vanilla forum system architecture.

    I ended up wading through poorly documented code adding logging through classes and methods as they were called trying to trace the error. I started in the editor plugin, which took me to media classes, which took me to the main GDN model class, and eventually into the Validation class.

    The error was occurring in the Validation class with the upload failing validation for lacking a required value for a “storageMethod” column, but no error was being logged or recorded anywhere that I could see.

    Eventually I figured this out, tried to to bypass validation, and finally received a useful database insert error stating a missing value for StorageMethod.

    I couldn’t find any info for “StorageMethod”, whether it was important or not - except for a few pages on google that suggested it was a removed feature that was no longer needed:

    https://github.com/vanilla/porter/issues/75#issuecomment-126535979

    From here I removed the StorageMethod column and the problem went away.

    Thanks @Bleistivt for trying to give some useful suggestions. Unfortunately in this case the problem was much deeper.

    whu606
  • whu606whu606 I'm not a SuperHero; I just like wearing tights... Moderator

    Thanks for the detailed explanation.

  • R_JR_J Cheerleader & Troubleshooter Munich Moderator

    @pinchies said:

    @whu606 said:
    @pinchies

    It is considered polite to provide the solution when you answer your own question, to help others in the future.

    Cheers... I was planning to, just not at 3:30am...

    PROBLEM:
    The solution was a database table structure issue. For some reason I had “StorageMethod” as a mandatory column in the Media table.

    SOLUTION:
    Removing “StorageMethod” from the structure of table “Media” fixed the issue.

    CAUSE
    It seems at some point there was support for uploading files to Amazon S3, but this was pulled or removed at some point. I don’t know how my database structure ended stuffed, but now I am still wondering if there are other database issues with my install too.

    You should run https://jgauroraforum.com/utility/structure if you have any concerns

    pinchies
  • Thank you - that is very useful, it found a few things I apparently need to change! Is there any kind of Troubleshooting FAQ page for Vanilla? That's exactly the kind of tip that should be listed!! :+1:

  • R_JR_J Cheerleader & Troubleshooter Munich Moderator

    It is not in any trouble shooting faq that I know of. But it is part of the normal update process. There will be some messages that will keep on appearing on /utility/structure. Don't worry about them.

Sign In or Register to comment.