FriendsOfFlarum upload, the intelligent file attachment extension
Hello, sorry if it's been asked already, but I couldn't find this in the previous messages with a quick search, nor in the future milestones page: is the extension going to support copy/pasting of images? I've seen there's another one that does it, but it's been abandoned as far as I undestood.
Thank you! ?
AbusingBruno pasting from the clipboard is not yet supported, seems like an interesting thing to implement though. Feel free to open an issue on github so you can track progress.
When the file name is Korean, the multi-upload is not performed.
Can you help me?
- Edited
luceos Thanks for this work. I will definitely stay tuned on further evolutions.
As a minor remark : I'm using version 0.4.2 right now, with french language enabled. I have noticed that the admin section of the extention is not 100% translated (instructions for mime types for instance, plus a couple of others areas). Please give me a shout if I can help to fix that by providing the missing translations.
ADulson feel free to edit this file it should allow you to create a fork and pull request automatically without doing those manually. Make sure you first copy the en.yml contents in and then edit the string behind the keys. Much appreciated if you could arrange that for your fellow locale users.
wowmac I'm not sure, could you specify your issue?
Published 0.4.3 that fixes the filename problem adding the old extension into the name.
- Edited
luceos I'm not sure, could you specify your issue?
i want to multi files upload(over 2 files),
files name is 2byte language(한글.jpg) .. cannot upload. but one file upload is ok.
when try 2 files (한글파일.jpg + 샘플파일.png) upload..error "Oops! Something went wrong. Please reload the page and try again."
when try 2files (샘플파일.jpg + samplefile.gif).. multi-upload is performed.
so i cannot multi-upload (files name is korean) over 2 files.
Is there enough explanation?
- Edited
If I understand you correctly. You have had success with exactly one or two file uploads in a single post, while any more than this gives an error. Is that correct?
I haven't checked to see if this errors for me yet, but am wondering if you've checked limitations of your webserver or php configuration. By default, php will only allow 2MB or 8MB. You could simple be hitting that limit.
Another thought @luceos is the size limit for upload in the extension settings per file or per post?
- Edited
It's not a matter of capacity.
The problem is that the file name is in Korean.
If the file name is korean, it means that if you try to upload more than 2 files, an error occurs.
I'm sorry I did not speak English well.
Please note that the capacity of uploaded files does not exceed 1 megabyte.
No worries. Curious that error occurs. Hoping luceos has an idea here, I'd like to know why that happens.
- Edited
luceos
when debug is true and retry, this error massege..
POST http://witple.com/api/flagrow/upload
{
"errors": [
{
"code": 500,
"title": "Internal server error",
"detail": "League\\Flysystem\\FileExistsException: File already exists at path: 2017-01-30/08:22:070-.jpeg in /home/witple/public_html/vendor/league/flysystem/src/Filesystem.php:401\nStack trace:\n#0 /home/witple/public_html/vendor/league/flysystem/src/Filesystem.php(81): League\\Flysystem\\Filesystem->assertAbsent('2017-01-30/08:2...')\n#1 /home/witple/public_html/vendor/flagrow/upload/src/Adapters/Flysystem.php(52): League\\Flysystem\\Filesystem->writeStream('2017-01-30/08:2...', Resource id #69)\n#2 /home/witple/public_html/vendor/flagrow/upload/src/Commands/UploadHandler.php(135): Flagrow\\Upload\\Adapters\\Flysystem->upload(Object(Flagrow\\Upload\\File), Object(Symfony\\Component\\HttpFoundation\\File\\UploadedFile), Resource id #69)\n#3 [internal function]: Flagrow\\Upload\\Commands\\UploadHandler->Flagrow\\Upload\\Commands\\{closure}(Object(Flagrow\\Upload\\File), 1)\n#4 /home/witple/public_html/vendor/illuminate/support/Collection.php(469): array_map(Object(Closure), Array, Array)\n#5 /home/witple/public_html/vendor/flagrow/upload/src/Commands/UploadHandler.php(166): Illuminate\\Support\\Collection->map(Object(Closure))\n#6 [internal function]: Flagrow\\Upload\\Commands\\UploadHandler->handle(Object(Flagrow\\Upload\\Commands\\Upload))\n#7 /home/witple/public_html/vendor/illuminate/bus/Dispatcher.php(202): call_user_func(Array, Object(Flagrow\\Upload\\Commands\\Upload))\n#8 [internal function]: Illuminate\\Bus\\Dispatcher->Illuminate\\Bus\\{closure}(Object(Flagrow\\Upload\\Commands\\Upload))\n#9 /home/witple/public_html/vendor/illuminate/pipeline/Pipeline.php(139): call_user_func(Object(Closure), Object(Flagrow\\Upload\\Commands\\Upload))\n#10 [internal function]: Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Flagrow\\Upload\\Commands\\Upload))\n#11 /home/witple/public_html/vendor/illuminate/pipeline/Pipeline.php(102): call_user_func(Object(Closure), Object(Flagrow\\Upload\\Commands\\Upload))\n#12 /home/witple/public_html/vendor/illuminate/bus/Dispatcher.php(204): Illuminate\\Pipeline\\Pipeline->then(Object(Closure))\n#13 /home/witple/public_html/vendor/illuminate/bus/Dispatcher.php(177): Illuminate\\Bus\\Dispatcher->dispatchNow(Object(Flagrow\\Upload\\Commands\\Upload), NULL)\n#14 /home/witple/public_html/vendor/flagrow/upload/src/Api/Controllers/UploadController.php(52): Illuminate\\Bus\\Dispatcher->dispatch(Object(Flagrow\\Upload\\Commands\\Upload))\n#15 /home/witple/public_html/vendor/flarum/core/src/Api/Controller/AbstractSerializeController.php(96): Flagrow\\Upload\\Api\\Controllers\\UploadController->data(Object(Zend\\Stratigility\\Http\\Request), Object(Tobscure\\JsonApi\\Document))\n#16 /home/witple/public_html/vendor/flarum/core/src/Http/Handler/ControllerRouteHandler.php(52): Flarum\\Api\\Controller\\AbstractSerializeController->handle(Object(Zend\\Stratigility\\Http\\Request))\n#17 /home/witple/public_html/vendor/flarum/core/src/Http/Middleware/DispatchRoute.php(71): Flarum\\Http\\Handler\\ControllerRouteHandler->__invoke(Object(Zend\\Stratigility\\Http\\Request), Array)\n#18 /home/witple/public_html/vendor/zendframework/zend-stratigility/src/Dispatch.php(224): Flarum\\Http\\Middleware\\DispatchRoute->__invoke(Object(Zend\\Stratigility\\Http\\Request), Object(Zend\\Stratigility\\Http\\Response), Object(Zend\\Stratigility\\Next))\n#19 /home/witple/public_html/vendor/zendframework/zend-stratigility/src/Dispatch.php(88): Zend\\Stratigility\\Dispatch->dispatchCallableMiddleware(Object(Flarum\\Http\\Middleware\\DispatchRoute), Object(Zend\\Stratigility\\Next), Object(Zend\\Stratigility\\Http\\Request), Object(Zend\\Stratigility\\Http\\Response), NULL)\n#20 /home/witple/public_html/vendor/zendframework/zend-stratigility/src/Next.php(160): Zend\\Stratigility\\Dispatch->__invoke(Object(Zend\\Stratigility\\Route), NULL, Object(Zend\\Stratigility\\Http\\Request), Object(Zend\\Stratigility\\Http\\Response), Object(Zend\\Stratigility\\Next))\n#21 /home/witple/public_html/vendor/flarum/core/src/Http/Middleware/SetLocale.php(50): Zend\\Stratigility\\Next->__invoke(Object(Zend\\Stratigility\\Http\\Request), Object(Zend\\Stratigility\\Http\\Response))\n#22 /home/witple/public_html/vendor/zendframework/zend-stratigility/src/Dispatch.php(224): Flarum\\Http\\Middleware\\SetLocale->__invoke(Object(Zend\\Stratigility\\Http\\Request), Object(Zend\\Stratigility\\Http\\Response), Object(Zend\\Stratigility\\Next))\n#23 /home/witple/public_html/vendor/zendframework/zend-stratigility/src/Dispatch.php(88): Zend\\Stratigility\\Dispatch->dispatchCallableMiddleware(Object(Flarum\\Http\\Middleware\\SetLocale), Object(Zend\\Stratigility\\Next), Object(Zend\\Stratigility\\Http\\Request), Object(Zend\\Stratigility\\Http\\Response), NULL)\n#24 /home/witple/public_html/vendor/zendframework/zend-stratigility/src/Next.php(160): Zend\\Stratigility\\Dispatch->__invoke(Object(Zend\\Stratigility\\Route), NULL, Object(Zend\\Stratigility\\Http\\Request), Object(Zend\\Stratigility\\Http\\Response), Object(Zend\\Stratigility\\Next))\n#25 /home/witple/public_html/vendor/flarum/core/src/Http/Middleware/AuthenticateWithHeader.php(57): Zend\\Stratigility\\Next->__invoke(Object(Zend\\Stratigility\\Http\\Request), Object(Zend\\Stratigility\\Http\\Response))\n#26 /home/witple/public_html/vendor/zendframework/zend-stratigility/src/Dispatch.php(224): Flarum\\Http\\Middleware\\AuthenticateWithHeader->__invoke(Object(Zend\\Stratigility\\Http\\Request), Object(Zend\\Stratigility\\Http\\Response), Object(Zend\\Stratigility\\Next))\n#27 /home/witple/public_html/vendor/zendframework/zend-stratigility/src/Dispatch.php(88): Zend\\Stratigility\\Dispatch->dispatchCallableMiddleware(Object(Flarum\\Http\\Middleware\\AuthenticateWithHeader), Object(Zend\\Stratigility\\Next), Object(Zend\\Stratigility\\Http\\Request), Object(Zend\\Stratigility\\Http\\Response), NULL)\n#28 /home/witple/public_html/vendor/zendframework/zend-stratigility/src/Next.php(160): Zend\\Stratigility\\Dispatch->__invoke(Object(Zend\\Stratigility\\Route), NULL, Object(Zend\\Stratigility\\Http\\Request), Object(Zend\\Stratigility\\Http\\Response), Object(Zend\\Stratigility\\Next))\n#29 /home/witple/public_html/vendor/flarum/core/src/Http/Middleware/AuthenticateWithSession.php(33): Zend\\Stratigility\\Next->__invoke(Object(Zend\\Stratigility\\Http\\Request), Object(Zend\\Stratigility\\Http\\Response))\n#30 /home/witple/public_html/vendor/zendframework/zend-stratigility/src/Dispatch.php(224): Flarum\\Http\\Middleware\\AuthenticateWithSession->__invoke(Object(Zend\\Stratigility\\Http\\Request), Object(Zend\\Stratigility\\Http\\Response), Object(Zend\\Stratigility\\Next))\n#31 /home/witple/public_html/vendor/zendframework/zend-stratigility/src/Dispatch.php(88): Zend\\Stratigility\\Dispatch->dispatchCallableMiddleware(Object(Flarum\\Http\\Middleware\\AuthenticateWithSession), Object(Zend\\Stratigility\\Next), Object(Zend\\Stratigility\\Http\\Request), Object(Zend\\Stratigility\\Http\\Response), NULL)\n#32 /home/witple/public_html/vendor/zendframework/zend-stratigility/src/Next.php(160): Zend\\Stratigility\\Dispatch->__invoke(Object(Zend\\Stratigility\\Route), NULL, Object(Zend\\Stratigility\\Http\\Request), Object(Zend\\Stratigility\\Http\\Response), Object(Zend\\Stratigility\\Next))\n#33 /home/witple/public_html/vendor/flarum/core/src/Http/Middleware/RememberFromCookie.php(38): Zend\\Stratigility\\Next->__invoke(Object(Zend\\Stratigility\\Http\\Request), Object(Zend\\Stratigility\\Http\\Response))\n#34 /home/witple/public_html/vendor/zendframework/zend-stratigility/src/Dispatch.php(224): Flarum\\Http\\Middleware\\RememberFromCookie->__invoke(Object(Zend\\Stratigility\\Http\\Request), Object(Zend\\Stratigility\\Http\\Response), Object(Zend\\Stratigility\\Next))\n#35 /home/witple/public_html/vendor/zendframework/zend-stratigility/src/Dispatch.php(88): Zend\\Stratigility\\Dispatch->dispatchCallableMiddleware(Object(Flarum\\Http\\Middleware\\RememberFromCookie), Object(Zend\\Stratigility\\Next), Object(Zend\\Stratigility\\Http\\Request), Object(Zend\\Stratigility\\Http\\Response), NULL)\n#36 /home/witple/public_html/vendor/zendframework/zend-stratigility/src/Next.php(160): Zend\\Stratigility\\Dispatch->__invoke(Object(Zend\\Stratigility\\Route), NULL, Object(Zend\\Stratigility\\Http\\Request), Object(Zend\\Stratigility\\Http\\Response), Object(Zend\\Stratigility\\Next))\n#37 /home/witple/public_html/vendor/flarum/core/src/Http/Middleware/StartSession.php(33): Zend\\Stratigility\\Next->__invoke(Object(Zend\\Stratigility\\Http\\Request), Object(Zend\\Stratigility\\Http\\Response))\n#38 /home/witple/public_html/vendor/zendframework/zend-stratigility/src/Dispatch.php(224): Flarum\\Http\\Middleware\\StartSession->__invoke(Object(Zend\\Stratigility\\Http\\Request), Object(Zend\\Stratigility\\Http\\Response), Object(Zend\\Stratigility\\Next))\n#39 /home/witple/public_html/vendor/zendframework/zend-stratigility/src/Dispatch.php(88): Zend\\Stratigility\\Dispatch->dispatchCallableMiddleware(Object(Flarum\\Http\\Middleware\\StartSession), Object(Zend\\Stratigility\\Next), Object(Zend\\Stratigility\\Http\\Request), Object(Zend\\Stratigility\\Http\\Response), NULL)\n#40 /home/witple/public_html/vendor/zendframework/zend-stratigility/src/Next.php(160): Zend\\Stratigility\\Dispatch->__invoke(Object(Zend\\Stratigility\\Route), NULL, Object(Zend\\Stratigility\\Http\\Request), Object(Zend\\Stratigility\\Http\\Response), Object(Zend\\Stratigility\\Next))\n#41 /home/witple/public_html/vendor/flarum/core/src/Api/Middleware/FakeHttpMethods.php(32): Zend\\Stratigility\\Next->__invoke(Object(Zend\\Stratigility\\Http\\Request), Object(Zend\\Stratigility\\Http\\Response))\n#42 /home/witple/public_html/vendor/zendframework/zend-stratigility/src/Dispatch.php(224): Flarum\\Api\\Middleware\\FakeHttpMethods->__invoke(Object(Zend\\Stratigility\\Http\\Request), Object(Zend\\Stratigility\\Http\\Response), Object(Zend\\Stratigility\\Next))\n#43 /home/witple/public_html/vendor/zendframework/zend-stratigility/src/Dispatch.php(88): Zend\\Stratigility\\Dispatch->dispatchCallableMiddleware(Object(Flarum\\Api\\Middleware\\FakeHttpMethods), Object(Zend\\Stratigility\\Next), Object(Zend\\Stratigility\\Http\\Request), Object(Zend\\Stratigility\\Http\\Response), NULL)\n#44 /home/witple/public_html/vendor/zendframework/zend-stratigility/src/Next.php(160): Zend\\Stratigility\\Dispatch->__invoke(Object(Zend\\Stratigility\\Route), NULL, Object(Zend\\Stratigility\\Http\\Request), Object(Zend\\Stratigility\\Http\\Response), Object(Zend\\Stratigility\\Next))\n#45 /home/witple/public_html/vendor/flarum/core/src/Http/Middleware/ParseJsonBody.php(30): Zend\\Stratigility\\Next->__invoke(Object(Zend\\Stratigility\\Http\\Request), Object(Zend\\Stratigility\\Http\\Response))\n#46 /home/witple/public_html/vendor/zendframework/zend-stratigility/src/Dispatch.php(224): Flarum\\Http\\Middleware\\ParseJsonBody->__invoke(Object(Zend\\Stratigility\\Http\\Request), Object(Zend\\Stratigility\\Http\\Response), Object(Zend\\Stratigility\\Next))\n#47 /home/witple/public_html/vendor/zendframework/zend-stratigility/src/Dispatch.php(88): Zend\\Stratigility\\Dispatch->dispatchCallableMiddleware(Object(Flarum\\Http\\Middleware\\ParseJsonBody), Object(Zend\\Stratigility\\Next), Object(Zend\\Stratigility\\Http\\Request), Object(Zend\\Stratigility\\Http\\Response), NULL)\n#48 /home/witple/public_html/vendor/zendframework/zend-stratigility/src/Next.php(160): Zend\\Stratigility\\Dispatch->__invoke(Object(Zend\\Stratigility\\Route), NULL, Object(Zend\\Stratigility\\Http\\Request), Object(Zend\\Stratigility\\Http\\Response), Object(Zend\\Stratigility\\Next))\n#49 /home/witple/public_html/vendor/zendframework/zend-stratigility/src/MiddlewarePipe.php(111): Zend\\Stratigility\\Next->__invoke(Object(Zend\\Stratigility\\Http\\Request), Object(Zend\\Stratigility\\Http\\Response))\n#50 /home/witple/public_html/vendor/flarum/core/src/Http/AbstractServer.php(53): Zend\\Stratigility\\MiddlewarePipe->__invoke(Object(Zend\\Stratigility\\Http\\Request), Object(Zend\\Stratigility\\Http\\Response), NULL)\n#51 /home/witple/public_html/vendor/zendframework/zend-diactoros/src/Server.php(166): Flarum\\Http\\AbstractServer->__invoke(Object(Zend\\Diactoros\\ServerRequest), Object(Zend\\Diactoros\\Response), NULL)\n#52 /home/witple/public_html/vendor/flarum/core/src/Http/AbstractServer.php(34): Zend\\Diactoros\\Server->listen()\n#53 /home/witple/public_html/api.php(16): Flarum\\Http\\AbstractServer->listen()\n#54 {main}"
}
]
}
Can you check it?
wowmac 2017-01-30/08:22:070-.jpeg
That's exactly what I was afraid of, the in-built file name generator I was using is replacing any invalid characters.. Just to make sure we don't get any disk persistence issues. I'll have to investigate this. Perhaps I should simply replace the filename with a unique hash.
I have this on the button
- Edited
Hello, I'm having some problems with my installation of this plugin.
This keeps showing up whenever I try and upload an image.
When I click on the debug button, it shows an internal server error.
I've tried modifying the php upload settings in php.ini, but I don't think it has anything to do with the error.
Can anyone please help?