• Extensions
  • FriendsOfFlarum upload, the intelligent file attachment extension

Even though I have made the settings correctly, I get the following error:
Uploading files of this type is not allowed.

    DursunCan
    Here are my settings. I force "Local" for images/videos but with an Imgur code registred, all images are upload to Imgur... 😅

    • OpenDocs (LibreOffice)
      application\/vnd\.oasis\.opendocument\.*
    • New XML MS Office Docs
      application\/vnd\.openxmlformats-officedocument\.*
    • Old MS Office Docs (Word/Excel)
      application\/msword
      application\/vnd\.ms-excel
    • Images, videos, mp3, PDF, ...
       (video\/(3gpp|mp4|mpeg|quicktime|webm))|(audio\/(aiff|midi|mpeg|mp4))|(image\/(gif|jpeg|png))|(application\/(x-(7z|rar)-compressed|zip|arj|x-(bzip2|gzip|lha|stuffit|tar)|pdf))
      

    Force these settings too:

    • Disable hotlink protection : Disable
    • Disable logging downloads : Disable
    • FBI likes this.

    Just had the 404 Not Found bug with downloading images (preview ok). I disabled the hotlink protection as suggested in this thread and it worked, thanks guys.

    Reactivating it re-introduce the bug: {"errors":[{"status":"404","code":"not_found","detail":"<stack trace>"}]}
    And here is the formatted stack trace:

    Illuminate\\Database\\Eloquent\\ModelNotFoundException in /home/nginx/flarum/vendor/flagrow/upload/src/Api/Controllers/DownloadController.php:58
    Stack trace:
    #0 /home/nginx/flarum/vendor/flarum/core/src/Http/RouteHandlerFactory.php(38): Flagrow\\Upload\\Api\\Controllers\\DownloadController-\u003Ehandle(Object(Zend\\Diactoros\\ServerRequest))
    #1 /home/nginx/flarum/vendor/flarum/core/src/Http/Middleware/DispatchRoute.php(65): Flarum\\Http\\RouteHandlerFactory-\u003EFlarum\\Http\\{closure}(Object(Zend\\Diactoros\\ServerRequest), Array)
    #2 /home/nginx/flarum/vendor/zendframework/zend-stratigility/src/Next.php(60): Flarum\\Http\\Middleware\\DispatchRoute-\u003Eprocess(Object(Zend\\Diactoros\\ServerRequest), Object(Closure)
    #3 /home/nginx/flarum/vendor/flarum/core/src/Http/Middleware/SetLocale.php(50): Zend\\Stratigility\\Next-\u003Ehandle(Object(Zend\\Diactoros\\ServerRequest))
    #4 /home/nginx/flarum/vendor/zendframework/zend-stratigility/src/Next.php(60): Flarum\\Http\\Middleware\\SetLocale-\u003Eprocess(Object(Zend\\Diactoros\\ServerRequest), Object(Zend\\Stratigility\\Next))
    #5 /home/nginx/flarum/vendor/flarum/core/src/Http/Middleware/CheckCsrfToken.php(23): Zend\\Stratigility\\Next-\u003Ehandle(Object(Zend\\Diactoros\\ServerRequest))
    #6 /home/nginx/flarum/vendor/zendframework/zend-stratigility/src/Next.php(60): Flarum\\Http\\Middleware\\CheckCsrfToken-\u003Eprocess(Object(Zend\\Diactoros\\ServerRequest), Object(Zend\\Stratigility\\Next))
    #7 /home/nginx/flarum/vendor/flarum/core/src/Http/Middleware/AuthenticateWithHeader.php(55): Zend\\Stratigility\\Next-\u003Ehandle(Object(Zend\\Diactoros\\ServerRequest))
    #8 /home/nginx/flarum/vendor/zendframework/zend-stratigility/src/Next.php(60): Flarum\\Http\\Middleware\\AuthenticateWithHeader-\u003Eprocess(Object(Zend\\Diactoros\\ServerRequest), Object(Zend\\Stratigility\\Next))
    #9 /home/nginx/flarum/vendor/flarum/core/src/Http/Middleware/AuthenticateWithSession.php(32): Zend\\Stratigility\\Next-\u003Ehandle(Object(Zend\\Diactoros\\ServerRequest))
    #10 /home/nginx/flarum/vendor/zendframework/zend-stratigility/src/Next.php(60): Flarum\\Http\\Middleware\\AuthenticateWithSession-\u003Eprocess(Object(Zend\\Diactoros\\ServerRequest), Object(Zend\\Stratigility\\Next))
    #11 /home/nginx/flarum/vendor/flarum/core/src/Http/Middleware/RememberFromCookie.php(51): Zend\\Stratigility\\Next-\u003Ehandle(Object(Zend\\Diactoros\\ServerRequest))
    #12 /home/nginx/flarum/vendor/zendframework/zend-stratigility/src/Next.php(60): Flarum\\Http\\Middleware\\RememberFromCookie-\u003Eprocess(Object(Zend\\Diactoros\\ServerRequest), Object(Zend\\Stratigility\\Next))
    #13 /home/nginx/flarum/vendor/flarum/core/src/Http/Middleware/StartSession.php(61): Zend\\Stratigility\\Next-\u003Ehandle(Object(Zend\\Diactoros\\ServerRequest))
    #14 /home/nginx/flarum/vendor/zendframework/zend-stratigility/src/Next.php(60): Flarum\\Http\\Middleware\\StartSession-\u003Eprocess(Object(Zend\\Diactoros\\ServerRequest), Object(Zend\\Stratigility\\Next))
    #15 /home/nginx/flarum/vendor/flarum/core/src/Api/Middleware/FakeHttpMethods.php(29): Zend\\Stratigility\\Next-\u003Ehandle(Object(Zend\\Diactoros\\ServerRequest))
    #16 /home/nginx/flarum/vendor/zendframework/zend-stratigility/src/Next.php(60): Flarum\\Api\\Middleware\\FakeHttpMethods-\u003Eprocess(Object(Zend\\Diactoros\\ServerRequest), Object(Zend\\Stratigility\\Next))
    #17 /home/nginx/flarum/vendor/flarum/core/src/Http/Middleware/ParseJsonBody.php(28): Zend\\Stratigility\\Next-\u003Ehandle(Object(Zend\\Diactoros\\ServerRequest))
    #18 /home/nginx/flarum/vendor/zendframework/zend-stratigility/src/Next.php(60): Flarum\\Http\\Middleware\\ParseJsonBody-\u003Eprocess(Object(Zend\\Diactoros\\ServerRequest), Object(Zend\\Stratigility\\Next))
    #19 /home/nginx/flarum/vendor/flarum/core/src/Http/Middleware/HandleErrors.php(57): Zend\\Stratigility\\Next-\u003Ehandle(Object(Zend\\Diactoros\\ServerRequest))
    #20 /home/nginx/flarum/vendor/zendframework/zend-stratigility/src/Next.php(60): Flarum\\Http\\Middleware\\HandleErrors-\u003Eprocess(Object(Zend\\Diactoros\\ServerRequest), Object(Zend\\Stratigility\\Next))
    #21 /home/nginx/flarum/vendor/zendframework/zend-stratigility/src/MiddlewarePipe.php(83): Zend\\Stratigility\\Next-\u003Ehandle(Object(Zend\\Diactoros\\ServerRequest))
    #22 /home/nginx/flarum/vendor/middlewares/request-handler/src/RequestHandler.php(84): Zend\\Stratigility\\MiddlewarePipe-\u003Eprocess(Object(Zend\\Diactoros\\ServerRequest), Object(Zend\\Stratigility\\Next))
    #23 /home/nginx/flarum/vendor/zendframework/zend-stratigility/src/Next.php(60): Middlewares\\RequestHandler-\u003Eprocess(Object(Zend\\Diactoros\\ServerRequest), Object(Zend\\Stratigility\\Next))
    #24 /home/nginx/flarum/vendor/middlewares/base-path-router/src/BasePathRouter.php(97): Zend\\Stratigility\\Next-\u003Ehandle(Object(Zend\\Diactoros\\ServerRequest))
    #25 /home/nginx/flarum/vendor/zendframework/zend-stratigility/src/Next.php(60): Middlewares\\BasePathRouter-\u003Eprocess(Object(Zend\\Diactoros\\ServerRequest), Object(Zend\\Stratigility\\Next))
    #26 /home/nginx/flarum/vendor/zendframework/zend-stratigility/src/Middleware/OriginalMessages.php(41): Zend\\Stratigility\\Next-\u003Ehandle(Object(Zend\\Diactoros\\ServerRequest))
    #27 /home/nginx/flarum/vendor/zendframework/zend-stratigility/src/Next.php(60): Zend\\Stratigility\\Middleware\\OriginalMessages-\u003Eprocess(Object(Zend\\Diactoros\\ServerRequest), Object(Zend\\Stratigility\\Next))
    #28 /home/nginx/flarum/vendor/middlewares/base-path/src/BasePath.php(53): Zend\\Stratigility\\Next-\u003Ehandle(Object(Zend\\Diactoros\\ServerRequest))
    #29 /home/nginx/flarum/vendor/zendframework/zend-stratigility/src/Next.php(60): Middlewares\\BasePath-\u003Eprocess(Object(Zend\\Diactoros\\ServerRequest), Object(Zend\\Stratigility\\Next))
    #30 /home/nginx/flarum/vendor/zendframework/zend-stratigility/src/MiddlewarePipe.php(83): Zend\\Stratigility\\Next-\u003Ehandle(Object(Zend\\Diactoros\\ServerRequest))
    #31 /home/nginx/flarum/vendor/zendframework/zend-stratigility/src/MiddlewarePipe.php(72): Zend\\Stratigility\\MiddlewarePipe-\u003Eprocess(Object(Zend\\Diactoros\\ServerRequest), Object(Zend\\Stratigility\\EmptyPipelineHandler))
    #32 /home/nginx/flarum/vendor/zendframework/zend-httphandlerrunner/src/RequestHandlerRunner.php(95): Zend\\Stratigility\\MiddlewarePipe-\u003Ehandle(Object(Zend\\Diactoros\\ServerRequest))
    #33 /home/nginx/flarum/vendor/flarum/core/src/Http/Server.php(44): Zend\\HttpHandlerRunner\\RequestHandlerRunner-\u003Erun()
    #34 /home/nginx/flarum/public/index.php(22): Flarum\\Http\\Server-\u003Elisten()
    #35 {main}

    Flarum & upload ext all up to date.

    9 days later

    I have read all the comments, may be my English is not very good, I hope I can support to upload MP3 / MP4 / SWF/and so on about the format of the images and video, what should I do?I am running flarum with using WINDOWS2012 , it's shows that. MP4 MIME types are: "video/MP4",what could i do if I want to upload the support of the MP4?Thank you!@luceos

    Getting this error when trying to download file. {"errors":[{"status":"404","code":"not_found"}]}
    I'm using the default download template.

      Swaggins
      Force these settings in the admin interface, flush the cache, retry.

      • Disable hotlink protection : Disable
      • Disable logging downloads : Disable

        Pherinos Thanks for the response! I just tried the above with no success. The URL points to /public/api/flagrow/download/ which does not exist...

          Swaggins Ouch!
          Are you on your own server or virtual server?
          Have you the SSH right to connect?

          I notice the public directory... with a /...

          Please geave us informations about your provider or/and the configuration you are using: private server or not, etc. And which rights you have on your "site" or domain.

          Regards

            Pherinos I created the flarum with the extensions I wanted using composer locally on my pc then zipped it up and unpacked it on my webhosting server with GoDaddy. I installed it on my server using the install wizzard. Everything seems to work fine. The only issue I have had is with this extension. I can see the files are being uploaded to my server. If I upload and image it works fine. Its only having issues with other file types. It points to a directory that doesn't exist.

              Swaggins
              I will be 90% away tomorrow so I will try to help you out in the weekend. Thank you for giving how you host your site, how you can access it (SSH / or FTP onlysic ...).

              I will answer you as soon as possible, I'm on Linux Unbuntu to do my tests with a dedicated server for production (and some tests).

              Please leave me your info by email: apperry@netc.eu

              Regards

              how to up load mp4? (windows2012.iis)
              mime:video/mp4
              anyone can tell me ,tks!

              1. Why do I get a 404 when I click the download button when I use the "Default image download template"? Also how do I make the download button into a view button?
                https://ws1.sinaimg.cn/large/b55e5057gy1g9xj4efwcoj20pk06vmxy.jpg
              2. When I chose to upload to Imgur, I set the customer id, but I did n’t respond when I clicked the upload image when posting.
                https://ws1.sinaimg.cn/large/b55e5057gy1g9xj0w131fj208d03kq2u.jpg

                You can check this problem on https://bbs.csur.fun/d/3-imgul

              Swaggins
              Did you force the settings in the admin interface?

              • Disable hotlink protection : Disable
              • Disable logging downloads : Disable

              I installed this plugin and filled in my amazon S3 settings. However, file are still being uploaded to my local folder.

                clarkwinkelmann for each type of file, you have to select which driver you would like to use.

                Yes, but with the "Imgur Upload" extension activated, all the images are on Imgur.
                I think there are conflicts between the extensions Upload/Imgur/Formatting.

                Bah! We are on Beta version! 😉

                I don't have "Imgur Upload" installed. And I can only choose "local" in the dropdown.

                  The flarum markdown extension is required

                  luceos disable and enable any extension.

                  Time saving tip (better if added to the Original Post)