• Extensions
  • FriendsOfFlarum upload, the intelligent file attachment extension

I'm having problems when uploading files in a post, right now trying with images. It does upload them fine, but it removes a period (.) from the extension of the file so there is not a preview unless I manually edit the link and add the period.

Does it have something to do with the regex? tried using the one supplied, and it still happens, thanks for the help.

Ralkage Thanks very much will be waiting as am developing a forum for a client

clarkwinkelmann Hi, sorry to repeat the post, just wanted to know if you knew what I could do to fix this, when uploading a file, using images right now, the preview does not want to show up (unless i edit it manually), and I see it's because the link is missing a period, do you know what I could try to fix this issue? Thank you,

    zaizeku which template are you using? Does it happen with all files, or only some formats?

    Can you share the output of your php flarum info so we can see the version of all extensions and Flarum?

      clarkwinkelmann Hi!, I've used both Default Image download template (can download but get no preview) and Complete Image preview template (can't see the image unless I add the period manually).

      Here's the flarum info:
      Flarum core 0.1.0-beta.15
      PHP version: 7.2.34
      Loaded extensions: Core, date, libxml, pcre, sqlite3, filter, hash, intl, json, mbstring, SPL, PDO, Reflection, sodium, pdo_sqlite, session, standard, bcmath, bz2, calendar, ctype, curl, dom, exif, fileinfo, ftp, gd, gettext, iconv, imap, mysqlnd, openssl, pcntl, pdo_mysql, zlib, posix, pspell, mysqli, SimpleXML, soap, sockets, tokenizer, xml, xmlreader, xmlrpc, xmlwriter, xsl, zip, Phar, imagick, memcached, Zend OPcache
      +----------------------+------------------+--------+
      | Flarum Extensions | | |
      +----------------------+------------------+--------+
      | ID | Version | Commit |
      +----------------------+------------------+--------+
      | flarum-approval | v0.1.0-beta.15 | |
      | flarum-bbcode | v0.1.0-beta.15 | |
      | flarum-emoji | v0.1.0-beta.15 | |
      | flarum-lang-english | v0.1.0-beta.15 | |
      | flarum-flags | v0.1.0-beta.15 | |
      | flarum-likes | v0.1.0-beta.15 | |
      | flarum-lock | v0.1.0-beta.15 | |
      | flarum-markdown | v0.1.0-beta.15 | |
      | flarum-mentions | v0.1.0-beta.15 | |
      | flarum-statistics | v0.1.0-beta.15 | |
      | flarum-sticky | v0.1.0-beta.15.1 | |
      | flarum-subscriptions | v0.1.0-beta.15 | |
      | flarum-suspend | v0.1.0-beta.15 | |
      | flarum-tags | v0.1.0-beta.15 | |
      | fof-upload | 0.13.1 | |
      +----------------------+------------------+--------+

      If I used this extensions for many images, how I can remove the extension and convert all images to be into the tag [img] [/img] ? Thanks. If I deactivate or unistall this extension all images in the community will be broken.
      There is a way to convert?

        peopleinside This extension will still be updated. They just marked it as incompatible so folks will stop asking (I assume).

        But, regardless, in case anyone ever wants to remove this extension even when it’s working, you’ll have broken images. Well, not anymore. Install the fof/upload patch:

        composer require zerosonesfun/patch-fof-upload

        Activate.

        Now your images appear again even without the upload extension.

          010101 Thanks but I want remove extensions that are not updated... I don't wanna add another new extension so I'm asking if there is a way to convert images strings created by fof/upload in without have to change all manually. Thank you.

            peopleinside Upload will be updated. As fof maintains 66 extensions it does take a bit. And sometimes people are busy with life, other responsibilities or just need a break.

            A little patience goes a long way, especially with people who do stuff for free.

              luceos sure luceos but I want use [img] for images so I'm really asking if an user decide to don't want use anymore this extension how can do to remove and have not the full forum images broken, without use another extension?

              I'm unable to update to Beta 16 even I removed all extensions seems cause the update to stop. I want use less extensions possible so now decided I want try to not use anymore an extension to upload images and see it inserted with a special strings that will not work without the extension.

                luceos this is just a patch to show images. If I remove fof/upload is because I want remove an extension not installing another one. I suppose there is no way, user or admin have to change one by one every image tag to [img][/img]

                  peopleinside Correct. There’s no way to do that without doing something else. Maybe the word patch is making you nervous? What I provided is what’s needed. Or, you can manually add some code to your forum's main extend.php file. You have to add a little bit of code to convert this extension's BBCode back into visible images.

                    peopleinside
                    You can try with a query to replace [upl-image-preview] with the appropriate <img> tag in the posts but if you try this way obviously don't try to do it in a production environment, do a backup of the database (and another one just to be sure), prepare another installation of flarum and try there.

                    010101 if there is something made me nervous is this https://discuss.flarum.org/d/26464-upgrading-from-beta-15-to-beta-16/22 I'm still unable to update to Beta 16 even if I try to remove extensions that are blocking upgrading.

                    extensions not updated is an issue so I have to try to have less extensions possible...
                    I will replace manually all images strings. I think is not good the fact an extension create the habitude to be comfortable in uploading images but when you decide to not use any more for different reason you will have issues.

                    Thanks for the patch but my scope is not replace upload extension with another one 😃