• Extensions
  • FriendsOfFlarum upload, the intelligent file attachment extension

luceos Yes ☹️ for now it's working with : (application\/(octet-stream)), but files are renamed .bin

luceos I've tried mime types for STL and nothing is working... Is (application\/(sla)) good ?

0.9.0

  • Exposes more detail in error messages when an upload fails mime validation
  • Support for Flarum beta.13

Requires minimum of flarum/core beta.12

Updating
composer require fof/upload
php flarum cache:clear

    I was using flagrow/upload extension whithout any issue.
    Upgrading to beta12, seems that flagrow/upload extension have to be replaced by fof/upload one.
    I removed flagrow/upload, installed fof/upload
    When I try to activate it, have this errors (debug mode activated) :

    POST https://lafabriq.org/forum/api/extensions/fof-upload

    PDOException: SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails (`cdlpweb_flarum`.`#sql-e3d_5330673`, CONSTRAINT `flfof_upload_downloads_post_id_foreign` FOREIGN KEY (`post_id`) REFERENCES `flposts` (`id`) ON DELETE SET NULL) in /home/cdlpweb/lafabriq.org/forum/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:117\nStack trace:
    #0 /home/cdlpweb/lafabriq.org/forum/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php(117): PDOStatement->execute(NULL)
    #1 /home/cdlpweb/lafabriq.org/forum/vendor/illuminate/database/Connection.php(458): Doctrine\\DBAL\\Driver\\PDOStatement->execute()
    #2 /home/cdlpweb/lafabriq.org/forum/vendor/illuminate/database/Connection.php(657): Illuminate\\Database\\Connection->Illuminate\\Database\\{closure}('alter table `fl...', Array)
    #3 /home/cdlpweb/lafabriq.org/forum/vendor/illuminate/database/Connection.php(624): Illuminate\\Database\\Connection->runQueryCallback('alter table `fl...', Array, Object(Closure))
    #4 /home/cdlpweb/lafabriq.org/forum/vendor/illuminate/database/Connection.php(459): Illuminate\\Database\\Connection->run('alter table `fl...', Array, Object(Closure))
    #5 /home/cdlpweb/lafabriq.org/forum/vendor/illuminate/database/Schema/Blueprint.php(97): Illuminate\\Database\\Connection->statement('alter table `fl...')
    #6 /home/cdlpweb/lafabriq.org/forum/vendor/illuminate/database/Schema/Builder.php(264): Illuminate\\Database\\Schema\\Blueprint->build(Object(Illuminate\\Database\\MySqlConnection), Object(Illuminate\\Database\\Schema\\Grammars\\MySqlGrammar))
    #7 /home/cdlpweb/lafabriq.org/forum/vendor/illuminate/database/Schema/Builder.php(149): Illuminate\\Database\\Schema\\Builder->build(Object(Illuminate\\Database\\Schema\\Blueprint))
    #8 /home/cdlpweb/lafabriq.org/forum/vendor/fof/upload/migrations/2020_02_06_07_alter_downloads_add_post_constraint.php(13): Illuminate\\Database\\Schema\\Builder->table('fof_upload_down...', Object(Closure))
    #9 [internal function]: Illuminate\\Filesystem\\Filesystem->{closure}(Object(Illuminate\\Database\\Schema\\MySqlBuilder))
    #10 /home/cdlpweb/lafabriq.org/forum/vendor/flarum/core/src/Database/Migrator.php(197): call_user_func(Object(Closure), Object(Illuminate\\Database\\Schema\\MySqlBuilder))
    #11 /home/cdlpweb/lafabriq.org/forum/vendor/flarum/core/src/Database/Migrator.php(128): Flarum\\Database\\Migrator->runClosureMigration(Array)
    #12 /home/cdlpweb/lafabriq.org/forum/vendor/flarum/core/src/Database/Migrator.php(111): Flarum\\Database\\Migrator->runUp('/home/cdlpweb/l...', '2020_02_06_07_a...', Object(Flarum\\Extension\\Extension))
    #13 /home/cdlpweb/lafabriq.org/forum/vendor/flarum/core/src/Database/Migrator.php(85): Flarum\\Database\\Migrator->runMigrationList('/home/cdlpweb/l...', Array, Object(Flarum\\Extension\\Extension))
    #14 /home/cdlpweb/lafabriq.org/forum/vendor/flarum/core/src/Extension/Extension.php(352): Flarum\\Database\\Migrator->run('/home/cdlpweb/l...', Object(Flarum\\Extension\\Extension))
    #15 /home/cdlpweb/lafabriq.org/forum/vendor/flarum/core/src/Extension/ExtensionManager.php(234): Flarum\\Extension\\Extension->migrate(Object(Flarum\\Database\\Migrator), 'up')
    #16 /home/cdlpweb/lafabriq.org/forum/vendor/flarum/core/src/Extension/ExtensionManager.php(127): Flarum\\Extension\\ExtensionManager->migrate(Object(Flarum\\Extension\\Extension))
    #17 /home/cdlpweb/lafabriq.org/forum/vendor/flarum/core/src/Api/Controller/UpdateExtensionController.php(48): Flarum\\Extension\\ExtensionManager->enable('fof-upload')
    ...

    php flarum info

    Flarum core 0.1.0-beta.12
    PHP version: 7.2.30
    Loaded extensions: Core, date, libxml, openssl, pcre, sqlite3, zlib, bz2, calendar, ctype, curl, hash, filter, ftp, gettext, gmp, SPL, iconv, pcntl, readline, Reflection, session, standard, shmop, SimpleXML, mbstring, tokenizer, xml, bcmath, dom, enchant, fileinfo, gd, imap, intl, json, ldap, exif, mysqli, mysqlnd, PDO, pdo_mysql, pdo_pgsql, pdo_sqlite, pgsql, Phar, posix, pspell, soap, sockets, sysvmsg, sysvsem, sysvshm, tidy, wddx, xmlreader, xmlrpc, xmlwriter, xsl, zip
    +---------------------------------+----------------+--------+
    | Flarum Extensions               |                |        |
    +---------------------------------+----------------+--------+
    | ID                              | Version        | Commit |
    +---------------------------------+----------------+--------+
    | milescellar-lang-french         | v1.6.0         |        |
    | flagrow-analytics               | 0.8.0          |        |
    | flarum-approval                 | v0.1.0-beta.12 |        |
    | noriods-auto-more               | 0.3.0          |        |
    | flarum-bbcode                   | v0.1.0-beta.12 |        |
    | michaelbelgium-discussion-views | v3.2.0         |        |
    | flarum-emoji                    | v0.1.0-beta.12 |        |
    | flagrow-direct-links            | 0.2.0          |        |
    | fof-impersonate                 | 0.4.0          |        |
    | flarum-flags                    | v0.1.0-beta.12 |        |
    | fof-byobu                       | 0.5.0          |        |
    | fof-default-user-preferences    | 0.1.0          |        |
    | fof-links                       | 0.3.0          |        |
    | fof-merge-discussions           | 0.3.3          |        |
    | fof-pages                       | 0.3.1          |        |
    | fof-polls                       | 0.1.2          |        |
    | fof-profile-image-crop          | 0.1.1          |        |
    | fof-socialprofile               | 0.1.2          |        |
    | fof-split                       | 0.4.3          |        |
    | fof-user-bio                    | 0.1.3          |        |
    | fof-user-directory              | 0.3.4          |        |
    | rooaaar-lang-french-extended    | 1.15.0         |        |
    | flarum-likes                    | v0.1.0-beta.12 |        |
    | flarum-lock                     | v0.1.0-beta.12 |        |
    | kilowhat-mailing                | 0.2.2          |        |
    | flarum-markdown                 | v0.1.0-beta.12 |        |
    | kvothe-pipetables               | 1.0.9          |        |
    | flarum-mentions                 | v0.1.0-beta.12 |        |
    | kvothe-online-users             | 0.4.0          |        |
    | zerosonesfun-pwa                | 1.3            |        |
    | flarum-pusher                   | v0.1.0-beta.12 |        |
    | reflar-level-ranks              | 1.2.2          |        |
    | flarum-statistics               | v0.1.0-beta.12 |        |
    | flarum-sticky                   | v0.1.0-beta.12 |        |
    | flarum-subscriptions            | v0.1.0-beta.12 |        |
    | flarum-suspend                  | v0.1.0-beta.12 |        |
    | flarum-tags                     | v0.1.0-beta.12 |        |
    | fof-html-errors                 | 0.3.1          |        |
    | extiverse-bazaar                | 0.4.1          |        |
    | squeevee-fancybox               | 0.2-beta       |        |
    +---------------------------------+----------------+--------+
    Base URL: https://lafabriq.org/forum
    Installation path: /home/cdlpweb/lafabriq.org/forum
    Debug mode: ON
      Merged 1 post from Unable to activate fof/upload.

      Th0mC I've merged your post into the fof/upload discussion & shortened your post so it doesn't occupy as much space.

        Th0mC Looks like your DB has entries for file uploads for which the posts have been deleted - and no longer exist.

        Looks like our migration needs more code to avoid this error. All you can do is either wait or go through every row in the flfof_upload_downloads table and check that their post IDs exist - if not, set the post_id column to NULL.

          datitisev You made it! In fact I had a discussion that was deleted and the discussion_id was set to NULL in flfof_upload_downloads but not the post_id. Put it at NULL as you suggested. Et voila 🙂

          0.9.1

          • Fix when DB has entries for file uploads for which the posts have been deleted, as mentioned by @datitisev above.
          Updating
          composer require fof/upload
          php flarum cache:clear

          I can't upload .cs files, when i upload .cs, file is renaming to .txt

          Powermage Correct image orientation based on the orientation info that mobile devices tend to use would be really great.

          Was this issue ever addressed? Users on my forum are still complaining about this issue.

            johnlewissims I'm using this CSS for that:

            .Post-body img, .Post-body iframe {
            max-height: 720px;
            }

            Otherwise mobile image would be gargantuan