• Extensions
  • FriendsOfFlarum upload, the intelligent file attachment extension

1622766664-982828-image1e6d34829e899cb9.png

When I upgraded the flarum program to 1.0.1 and installed the latest version of fof/upload plug-in, this problem occurred: an error occurred when clicking the Upload button, as shown in the Chrome console in the figure.

site: https://club.cnskyfans.com

    kindyear
    The problem has been solved, because 775 permissions are not set for the folder

    5 days later

    I use to be able to upload short videos via fof/upload, but after update to 1.0.2 it keep saying:

    Oops, something went wrong, try to refresh the page.

    • IanM replied to this.

      Anonymous43 Whenever you see Oops, something went wrong, try to refresh the page., it's very likely that there will be associated details in storage/logs/flarum-{date}.log and/or on the browser dev tools console.

      It's almost impossible to tell what's happening here purely from the generic error message. Please provide more information so that we might be able to help you..

      Will do when i get home. Was seeing if im the only lucky guy, or others as well.

      [2021-06-09 04:26:27] flarum.ERROR: FoF\Upload\Exceptions\InvalidUploadException: Upload max filesize limit reached from php.ini. in /public_html/vendor/fof/upload/src/Repositories/FileRepository.php:152
      Stack trace:
      #0 /public_html/vendor/fof/upload/src/Repositories/FileRepository.php(112): FoF\Upload\Repositories\FileRepository->handleUploadError(1)
      #1 /public_html/vendor/fof/upload/src/Commands/UploadHandler.php(91): FoF\Upload\Repositories\FileRepository->moveUploadedFileToTemp(Object(Laminas\Diactoros\UploadedFile))
      #2 [internal function]: FoF\Upload\Commands\UploadHandler->FoF\Upload\Commands\{closure}(Object(Laminas\Diactoros\UploadedFile), 0)

      What is it? Hosting limits?

        Anonymous43 seems as you allow a bigger upload that within your PHP settings. You need to increase your max upload from your hosting.

        6 days later

        In the "Configure your mime type, upload adapter mapping" I've added
        (application\/(x-(7z|rar|zip)-compressed|zip|arj|x-(bzip2|gzip|lha|stuffit|tar)|pdf)) >> Local >> Default File Download Template.

        When I try to upload a PDF file to the Media Manager I get an error "Uploading files of this type is not allowed."

        Anonymous43

        (application\/(x-(7z|rar|zip|pdf)-compressed|zip|arj|x-(bzip2|gzip|lha|stuffit|tar))

        Still giving me the same error. Similarly for the zip files.

          nickdecker This should work:

           (application\/(x-(7z|rar|zip)-compressed|zip|arj|x-(bzip2|gzip|lha|stuffit|tar)|pdf))

          Additionally, you may need to clear cache and try again later. If you're still having same issues try clearing cache manually by removing the contents of assets folder.

          If the plug uploads images to S3, does it consume server bandwidth or S3 bandwidth when the page is loaded? (choose complete image preview template)

          I know that uploading and downloading files uses server traffic, but I'm not sure if the images do the same.

          Sorry for my poor English...

            stimw yes if you use "preview" template, the image will be loaded using the S3 URL, so this will count traffic on your bucket.

            If you use the link or download templates the file won't be downloaded until the user clicks on it.

              clarkwinkelmann

              Thanks for your reply.

              Maybe "File → S3" (upload files directly to the S3 without going through the flarum server) is better than "File → flarum server → S3" ? It's a little strange for the flarum server to do the uploading and downloading as an intermediary, which increase the burden on the server.

                stimw I'm not really sure if there's a S3 API to allow client-side upload?

                Our implementation is done in a way that's compatible with the most number of adapters. Most require us to make the upload server-side because we need to send secret tokens with it.

                I think we do the same with Imgur even though Imgur also has a client-side upload method. But the client-side method would require a custom implementation whereas in the backend we can just use a common interface for all adapters.

                  I installed the latest stable version of upload, and I don't seem to have anything in my extensions sidebar. I already cleared the cache. Am I missing something?

                    GreXXL
                    Flarum core 1.0.2
                    PHP version: 7.4.3
                    Loaded extensions: Core, date, libxml, openssl, pcre, zlib, filter, hash, pcntl, Reflection, SPL, session, standard, sodium, mysqlnd, PDO, xml, calendar, ctype, curl, dom, mbstring, FFI, fileinfo, ftp, gd, gettext, iconv, json, exif, mysqli, pdo_mysql, Phar, posix, readline, shmop, SimpleXML, sockets, sysvmsg, sysvsem, sysvshm, tokenizer, xmlreader, xmlwriter, xsl, zip, Zend OPcache
                    +----------------------+---------+--------+
                    | Flarum Extensions | | |
                    +----------------------+---------+--------+
                    | ID | Version | Commit |
                    +----------------------+---------+--------+
                    | flarum-approval | v1.0.0 | |
                    | flarum-bbcode | v1.0.0 | |
                    | flarum-emoji | v1.0.0 | |
                    | flarum-lang-english | v1.0.0 | |
                    | flarum-flags | v1.0.0 | |
                    | flarum-likes | v1.0.0 | |
                    | flarum-lock | v1.0.0 | |
                    | flarum-markdown | v1.0.1 | |
                    | flarum-mentions | v1.0.0 | |
                    | flarum-statistics | v1.0.0 | |
                    | flarum-sticky | v1.0.0 | |
                    | flarum-subscriptions | v1.0.0 | |
                    | flarum-suspend | v1.0.0 | |
                    | flarum-tags | v1.0.3 | |
                    +----------------------+---------+--------+

                    And here is the install log after I ran the composer command:

                    
                    Using version ^1.0 for fof/upload
                    ./composer.json has been updated
                    Running composer update fof/upload
                    Loading composer repositories with package information
                    Updating dependencies
                    Lock file operations: 5 installs, 0 updates, 0 removals
                      - Locking fof/upload (1.0.1)
                      - Locking guzzlehttp/guzzle (7.3.0)
                      - Locking guzzlehttp/promises (1.4.1)
                      - Locking psr/http-client (1.0.1)
                      - Locking softcreatr/php-mime-detector (3.2.1)
                    Writing lock file
                    Installing dependencies from lock file (including require-dev)
                    Package operations: 5 installs, 0 updates, 0 removals
                      - Installing softcreatr/php-mime-detector (3.2.1): Extracting archive
                      - Installing psr/http-client (1.0.1): Extracting archive
                      - Installing guzzlehttp/promises (1.4.1): Extracting archive
                      - Installing guzzlehttp/guzzle (7.3.0): Extracting archive
                      - Installing fof/upload (1.0.1): Extracting archive
                    3 package suggestions were added by new dependencies, use `composer suggest` to see details.
                    Generating autoload files
                    71 packages you are using are looking for funding.
                    Use the `composer fund` command to find out more!