blueimp jQuery-File-Upload not working for laravel 5 - laravel-5

i am using , https://github.com/blueimp/jQuery-File-Upload plugin for image upload using ajax call in laravel 5. i also refered article http://peterjolson.com/using-laravel-and-jquery-file-upload/. but i am getting the following error error
GET http://localhost:8000/...../server/php/ 500 (Internal
Server Error)
when i use https://github.com/blueimp/jQuery-File-Upload/wiki/Basic-plugin i get the same error. Can anyone help with this or please suggest any working image uploader with ajax call for laravel 5

There is a main.js file, you need to adjust the url there according to the path you store it:
url: '../../uploadimage/server/php/'

Related

Codeigniter 4 customized route is showing me a 404 error

i'm using CodeIgniter 4 and having trouble creating a route
I have this url
/Show/post/100008
But I want to route it to this
/post/100008
I've tried
$routes->get('/post/(:num)', 'Show::post/(:num)');
but i'm getting 404 error when typing /post/100008 url only
Is the route correct or is there any other solution for it?
Thank you
The solution is by changing the line to
$routes->get('/post/(:num)', 'Show::post/$1');
Codeigniter 4 URI Routing docs : https://codeigniter.com/user_guide/incoming/routing.html

unable to generate PDF from spatie bowsershot

i have installed browsershot in my laravel project
I have installed puppeteer, installed chromium , my npm version is updated, but still i am unable to get the PDF of my simple html input , i have tried to take screenshot by URL method and save as image(It works), but my requirement is to generate PDF of my html.
This is my code in controller
$output=Browsershot::html($html)
->setNodeModulePath("/var/www/html/ProjectName/node_modules/")
->setChromePath("/usr/bin/chromium-browser")
->setNodeBinary('/usr/local/bin/node')
->setNpmBinary('/usr/local/bin/npm')
->showBackground()
->noSandbox()->timeout(60)
->save(public_path("DevTest.pdf");
Error Message:
"message": "The process "PATH=$PATH:/usr/local/bin NODE_PATH='/var/www/html/ProjectName/node_modules/' /usr/local/bin/node '/var/www/html/benesprint/vendor/spatie/browsershot/src/../bin/browser.js' '{"url":"file:\/\/\/tmp\/1933874416-0068512001600765779\/index.html","action":"pdf","options":{"path":"\/var\/www\/html\/ProjectName\/public\/DevTest.pdf","args":["--no-sandbox"],"viewport":{"width":800,"height":600},"displayHeaderFooter":false,"executablePath":"\/usr\/bin\/chromium-browser","timeout":60000,"printBackground":true}}'" exceeded the timeout of 60 seconds.",
**i would be grateful if you can help me out.**
i have similiar problem when browsershot inside container. and my step to resolve is like this:
Manual generate PDF from html using laravel tinker. if there is an error, try reinstall chromium and puppeteer library.
If success, then try remove all css and javascript links from html, and check for the result.
If success, then add --proxy-server="direct://" and --proxy-bypass-list=* into browsershot args
If step 3 is not working, then you can put css and javascript directly into view template or using php code to inclue those files like
<?php include public_path('css/styles.css') ?>

Provisional headers are shown in laravel + ionic

I'am using laravel + ionic.
my ionic is run on localhost:8100.
and my laravel is running on myDomain/get/posts/comment.
Iam using vagrant box for laravel.
my problem is when I access the myDomain/get/posts/comment throw browser, I got the response.
bu when I call this URL through ionic, response status code is 200.
but showind Provisional headers are shown.
Please help me to solve this.
I searched on internet for solution, but couldn't solve.

Laravel 4 : why did I get 2 different of 404 error page?

I'm using Laravel 4.2 framework for my website, and want it catch my 404 error correctly. My problem is that the server return a different 404 page when I try to open some bad link inside the public folder. Please give me some advice, thank you very much.
Folder structure:
-- app
-- bootstrap
-- public
--assets
--packagespage
-- vender
Normally, I set my 404 page like this:
When I tried http://localhost:8000/assets/some-name and http://localhost:8000/packages/some-name => new 404 page here:

image display in codeigniter shows error

I am relatively new to Codeigniter, basically I choose CakePHP to develope applications. Now I am editing a Codeigniter Project, build in version 2. I have some images in my table and I need to disply it.
I have created a helper file general_helper.php in which I have a function
function image_url(){
return base_url().'uploads/';
}
So in view page , I tried to display image by
<img src="http://localhost/myapp/uploads/vendors/images/Desert.jpg" />
My directory structure is :
myapp
-uploads
-vendors
-images
-logos
But its not showing the image ! When I tried to put the image path in the url, it shows 404 error :( whats wrong ?
Codeigniter base_url function requires folder path relative to site's base url passed as parameters. Please try use below code.
First in constructor, please load your library -
$this->load->library('general');
Then please pass your uploads directory as parameter to base_url
function image_url(){
return base_url('uploads/');
}
If images are not uploading please do check image type.
Also try use log_message('info','info_message') function to record base url.
Please refer http://www.codeigniter.com/userguide2/general/errors.html

Resources