• Extensions
  • FriendsOfFlarum upload, the intelligent file attachment extension

MikeJones Is 8 gigs not enough to run flarum?

On your "/" you have the system and other things... For Flarum sources I have 73M used, but you need space for the database, the system, backups, etc. So I think 8G is too little. Try to upgrade your VM to 32G for "/" and test it.

    Question:
    A Geogebra file is a ZIP file, but with the extension ".GGB".
    The Mime-Type is "application/vnd.geogebra\.file", but when I configure this one as "application\/vnd.geogebra\.file" or "application\/vnd.geogebra\.*" I have an error... or the specific error "Uploading files of this type is not allowed.
    "

    Any idea?

    Thanks.

    luceos
    Raaahhhhh ! After testing mime-types, the error is back!!! 👎

    {"errors":[{"status":"404","code":"not_found"}]}

    Edit: without these settings, there is the error. With the settings all is good. Strange...
    Disable hotlink protection : Disable
    Disable logging downloads : Disable

    Check these settings for each modification!

    Is there any way to add an alt value to the images uploaded because the upl code does not have any such option. I would want to alt tags so that my images show up in google image search also as sometimes the image file names are not quite accurate.

    Hello, It seems that the configuration page of the extensions does not take any change (resize for exemple, i check the box but the conf is not save).
    The upload seems to work , i see some files on the local serve /public/asset/files
    But nothing imbeded in the post
    What are the permission needed in permission tab ?

    9 days later

    ozkan34 1) show loading progress can be added

    Really really want this too! I have large images to upload on my site lol

    Unable to translate exceptions in UploadHandler.php :

     87 
     88                 if (!$adapter) {
     89                     throw new ValidationException(['upload' => 'Uploading files of this type is not allowed.']);
     90                 }
     91 
     92                 if (!$adapter->forMime($upload->getClientMimeType())) {
     93                     throw new ValidationException(['upload' => "Upload adapter does not support the provided mime type: {$upload->getClientMimeType()}."]);
     94                 }
     95 

    I want to display PDF "inline" (view in PDF viewer of Chrome for example) when the client click for a download of a PDF file...
    I worked with .htaccess but no result.

    <IfModule mod_headers.c>
      RequestHeader unset Proxy
        <FilesMatch "\.(pdf|PDF)$">
            Header set Content-type: "application/pdf"
            Header set Content-Disposition: "inline; filename=FILENAME.pdf"
            Allow from all
        </FilesMatch>
    </IfModule>

    Any idea????.... ?

    Edit:

    Does not work:

    <IfModule mod_headers.c>
      RequestHeader unset Proxy
      <FilesMatch "\.(pdf|PDF)$" >
        ForceType application/octet-stream
        Header add Content-Disposition "inline"
      </FilesMatch>
    </IfModule>
      9 days later

      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.