Flagrow image uploader for Flarum forum messages
yesterday I started to get this two messages every time, when I try to install, update or do anything else through composer:
1. "
The "https://packagist.org/packages.json" file could not be downloaded: php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution
failed to open stream: php_network_getaddresses: getaddrinfo failed: Temporary failure in name resolution
https://packagist.org could not be fully loaded, package information was loaded from the local cache and may be out of date
"
- " [Composer\Downloader\TransportException]
The "https://packagist.org/p/illuminate/database%242a57962e7835fa6917a8efd4
3b97c03c25f0584a9b8455194a7cf74a10e50562.json" file could not be downloaded
(HTTP/1.1 404 Not Found)
"
What is this and can this be the reason that the extention was not installing right?
- Edited
Am unable to install this extension.
root@forum:~# composer require flagrow/flarum-ext-image-upload
Using version ^0.1.5 for flagrow/flarum-ext-image-upload
./composer.json has been created
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Installation request for flagrow/flarum-ext-image-upload ^0.1.5 -> satisfiable by flagrow/flarum-ext-image-upload[0.1.5].
- flagrow/flarum-ext-image-upload 0.1.5 requires flarum/core ^0.1.0-beta.4 -> no matching package found.
Potential causes:
- A typo in the package name
- The package is not available in a stable-enough version according to your minimum-stability setting
see <https://groups.google.com/d/topic/composer-dev/_g3ASeIFlrc/discussion> for more details.
Read <https://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.
Installation failed, deleting ./composer.json.
root@forum:~#
Am running Flarum beta 4. Any ideas?
ron_jeremy In what folder are you running the command? It should be at flarum's root folder.
- Edited
ron_jeremy Try adding the following to your composer.json
"minimum-stability": "beta"
It says the problem is the minimum stability to beta.
I hope it solves your problem
EDIT: It also says there isn't a composer.json, are you in the root folder of the forum?
ron_jeremy In what folder are you running the command? It should be at flarum's root folder.
- @santiagobiali
I was not in the Flarum root folder. Thank you santiagobiali and datitisev
I do not know what i did bad but i can't upload any image using imgur, it instantly reward my 2 click with an "error". ?
BlackSheep API limit or ban?
luceos I'm sure that's not it. Is there a log for the uploader ?
BlackSheep that is a great feature request
- Edited
Some of my experience of using 0.2.0 beta2 on my beta4:
- In this version I don't see any progress of uploading (like it was in Imgur upload 1.0.0 - circle was spinning around), now you just sit and wait and it looks like nothing happened and then suddenly picture appears. This can be confusing for users.
- When I'm trying to upload big file (to Imgur) (3,5mb and about 5000x3000px) I got error:
In the Imgur upload 1.0.0 the same file uploads without any problem and you can see the uploading progress (spinning circle)!500 Internal Server Error POST http://forum.mysite.com/api/image/upload { "errors": [ { "code": 500, "title": "Internal server error", "detail": "exception 'RuntimeException' with message 'Cannot retrieve stream due to upload error' in /home/ignivis/public_html/mysite/forum/vendor/zendframework/zend-diactoros/src/UploadedFile.php:146\nStack trace:\n#0 /home/ignivis/public_html/mysite/forum/extensions/flagrow-image-upload/src/Commands/UploadImageHandler.php(106): Zend\\Diactoros\\UploadedFile->moveTo('/home/ignivis/p...')\n#1 [internal function]: Flagrow\\ImageUpload\\Commands\\UploadImageHandler->handle(Object(Flagrow\\ImageUpload\\Commands\\UploadImage))\n#2 /home/ignivis/public_html/mysite/forum/vendor/illuminate/bus/Dispatcher.php(203): call_user_func(Array, Object(Flagrow\\ImageUpload\\Commands\\UploadImage))\n#3 [internal function]: Illuminate\\Bus\\Dispatcher->Illuminate\\Bus\\{closure}(Object(Flagrow\\ImageUpload\\Commands\\UploadImage))\n#4 /home/ignivis/public_html/mysite/forum/vendor/illuminate/pipeline/Pipeline.php(139): call_user_func(Object(Closure), Object(Flagrow\\ImageUpload\\Commands\\UploadImage))\n#5 [internal function]: Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Flagrow\\ImageUpload\\Commands\\UploadImage))\n#6 /home/ignivis/public_html/mysite/forum/vendor/illuminate/pipeline/Pipeline.php(103): call_user_func(Object(Closure), Object(Flagrow\\ImageUpload\\Commands\\UploadImage))\n#7 /home/ignivis/public_html/mysite/forum/vendor/illuminate/bus/Dispatcher.php(204): Illuminate\\Pipeline\\Pipeline->then(Object(Closure))\n#8 /home/ignivis/public_html/mysite/forum/vendor/illuminate/bus/Dispatcher.php(177): Illuminate\\Bus\\Dispatcher->dispatchNow(Object(Flagrow\\ImageUpload\\Commands\\UploadImage), NULL)\n#9 /home/ignivis/public_html/mysite/forum/extensions/flagrow-image-upload/src/Api/Controllers/UploadImageController.php(60): Illuminate\\Bus\\Dispatcher->dispatch(Object(Flagrow\\ImageUpload\\Commands\\UploadImage))\n#10 /home/ignivis/public_html/mysite/forum/vendor/flarum/core/src/Api/Controller/AbstractSerializeController.php(96): Flagrow\\ImageUpload\\Api\\Controllers\\UploadImageController->data(Object(Zend\\Stratigility\\Http\\Request), Object(Tobscure\\JsonApi\\Document))\n#11 /home/ignivis/public_html/mysite/forum/vendor/flarum/core/src/Http/GenerateRouteHandlerTrait.php(35): Flarum\\Api\\Controller\\AbstractSerializeController->handle(Object(Zend\\Stratigility\\Http\\Request))\n#12 /home/ignivis/public_html/mysite/forum/vendor/flarum/core/src/Http/Middleware/DispatchRoute.php(67): Flarum\\Api\\ApiServiceProvider->Flarum\\Http\\{closure}(Object(Zend\\Stratigility\\Http\\Request), Array)\n#13 /home/ignivis/public_html/mysite/forum/vendor/zendframework/zend-stratigility/src/Dispatch.php(82): Flarum\\Http\\Middleware\\DispatchRoute->__invoke(Object(Zend\\Stratigility\\Http\\Request), Object(Zend\\Stratigility\\Http\\Response), Object(Zend\\Stratigility\\Next))\n#14 /home/ignivis/public_html/mysite/forum/vendor/zendframework/zend-stratigility/src/Next.php(113): Zend\\Stratigility\\Dispatch->__invoke(Object(Zend\\Stratigility\\Route), NULL, Object(Zend\\Stratigility\\Http\\Request), Object(Zend\\Stratigility\\Http\\Response), Object(Zend\\Stratigility\\Next))\n#15 /home/ignivis/public_html/mysite/forum/vendor/flarum/core/src/Api/Middleware/FakeHttpMethods.php(32): Zend\\Stratigility\\Next->__invoke(Object(Zend\\Stratigility\\Http\\Request), Object(Zend\\Stratigility\\Http\\Response))\n#16 /home/ignivis/public_html/mysite/forum/vendor/zendframework/zend-stratigility/src/Dispatch.php(82): Flarum\\Api\\Middleware\\FakeHttpMethods->__invoke(Object(Zend\\Stratigility\\Http\\Request), Object(Zend\\Stratigility\\Http\\Response), Object(Zend\\Stratigility\\Next))\n#17 /home/ignivis/public_html/mysite/forum/vendor/zendframework/zend-stratigility/src/Next.php(113): Zend\\Stratigility\\Dispatch->__invoke(Object(Zend\\Stratigility\\Route), NULL, Object(Zend\\Stratigility\\Http\\Request), Object(Zend\\Stratigility\\Http\\Response), Object(Zend\\Stratigility\\Next))\n#18 /home/ignivis/public_html/mysite/forum/vendor/flarum/core/src/Http/Middleware/ParseJsonBody.php(30): Zend\\Stratigility\\Next->__invoke(Object(Zend\\Stratigility\\Http\\Request), Object(Zend\\Stratigility\\Http\\Response))\n#19 /home/ignivis/public_html/mysite/forum/vendor/zendframework/zend-stratigility/src/Dispatch.php(82): Flarum\\Http\\Middleware\\ParseJsonBody->__invoke(Object(Zend\\Stratigility\\Http\\Request), Object(Zend\\Stratigility\\Http\\Response), Object(Zend\\Stratigility\\Next))\n#20 /home/ignivis/public_html/mysite/forum/vendor/zendframework/zend-stratigility/src/Next.php(113): 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/ignivis/public_html/mysite/forum/vendor/flarum/core/src/Api/Middleware/AuthenticateWithHeader.php(50): Zend\\Stratigility\\Next->__invoke(Object(Zend\\Stratigility\\Http\\Request), Object(Zend\\Stratigility\\Http\\Response))\n#22 /home/ignivis/public_html/mysite/forum/vendor/zendframework/zend-stratigility/src/Dispatch.php(82): Flarum\\Api\\Middleware\\AuthenticateWithHeader->__invoke(Object(Zend\\Stratigility\\Http\\Request), Object(Zend\\Stratigility\\Http\\Response), Object(Zend\\Stratigility\\Next))\n#23 /home/ignivis/public_html/mysite/forum/vendor/zendframework/zend-stratigility/src/Next.php(113): Zend\\Stratigility\\Dispatch->__invoke(Object(Zend\\Stratigility\\Route), NULL, Object(Zend\\Stratigility\\Http\\Request), Object(Zend\\Stratigility\\Http\\Response), Object(Zend\\Stratigility\\Next))\n#24 /home/ignivis/public_html/mysite/forum/vendor/flarum/core/src/Http/Middleware/AuthenticateWithCookie.php(42): Zend\\Stratigility\\Next->__invoke(Object(Zend\\Stratigility\\Http\\Request), Object(Zend\\Stratigility\\Http\\Response))\n#25 /home/ignivis/public_html/mysite/forum/vendor/zendframework/zend-stratigility/src/Dispatch.php(82): Flarum\\Http\\Middleware\\AuthenticateWithCookie->__invoke(Object(Zend\\Stratigility\\Http\\Request), Object(Zend\\Stratigility\\Http\\Response), Object(Zend\\Stratigility\\Next))\n#26 /home/ignivis/public_html/mysite/forum/vendor/zendframework/zend-stratigility/src/Next.php(113): Zend\\Stratigility\\Dispatch->__invoke(Object(Zend\\Stratigility\\Route), NULL, Object(Zend\\Stratigility\\Http\\Request), Object(Zend\\Stratigility\\Http\\Response), Object(Zend\\Stratigility\\Next))\n#27 /home/ignivis/public_html/mysite/forum/vendor/zendframework/zend-stratigility/src/MiddlewarePipe.php(75): Zend\\Stratigility\\Next->__invoke(Object(Zend\\Stratigility\\Http\\Request), Object(Zend\\Stratigility\\Http\\Response))\n#28 /home/ignivis/public_html/mysite/forum/vendor/zendframework/zend-diactoros/src/Server.php(166): Zend\\Stratigility\\MiddlewarePipe->__invoke(Object(Zend\\Diactoros\\ServerRequest), Object(Zend\\Diactoros\\Response), NULL)\n#29 /home/ignivis/public_html/mysite/forum/vendor/flarum/core/src/Http/AbstractServer.php(33): Zend\\Diactoros\\Server->listen()\n#30 /home/ignivis/public_html/mysite/forum/api.php(16): Flarum\\Http\\AbstractServer->listen()\n#31 {main}" } ] }
For now I'm back to Imgur upload 1.0.0, but hope to be able to use this new version, since it has local upload also, which I just love!
Do you have any ideas about this errors?
- About local upload in 0.2.0 beta2. If you delete post or delete picture from the post it doesn't delete picture from the folder, so folder soon becames full of old unused pictures.
- in 1.0.0 when you want to make maximum photo size (for example not bigger then 800px) - it works perfect - big pictures became smaller, small pictures stay the same small size (100px, 200px, etc..). In 0.2.0 beta2 in local upload when you add Maxiumum image size (for example 800px), small pictures also resized till 800px and looks terrible, of course, so there is no possibility just to make maximum size for big pictures, not touching small pictures, it's more like strict resize.
- Edited
Would it be possible to add a type of cdn/mirroring/proxy option to this extension?
Example, upload pictures to another server other than where the flarum forum is actually installed and then make the image links point directly to that said server?
This would be useful for people that need their community to upload a large quantity of images onto the forum so it would be best to just have another server just to store and serve those images so that everything loads super fast.
- Edited
Mount remote fs into upload directory?
VIRUXE Would it be possible to add a type of cdn/mirroring/proxy option to this extension?
Using the local adapter this is possible by setting a CDN Url. We haven't implemented to assist further on that account.
7h3ev1l Mount remote fs into upload directory?
You can do whatever remote mounting with the local adapter.