haitam1's avatar

Laravel CKEDITOR, image upload

Hi guys,

I am new to laravel, I wanted to create an upload image function so CKEDITOR can uplaod images to the server. I've searched on the internet for some tutorials or examples.

I tried this example, but it didn't work.

if (file_exists("img/" . $_FILES["upload"]["name"]))
{
    echo $_FILES["upload"]["name"] . " already exists please choose another image.";
}
else
{
    move_uploaded_file($_FILES["upload"]["tmp_name"],
    "img/" . $_FILES["upload"]["name"]);
    echo "Stored in: " . "img/" . $_FILES["upload"]["name"];
}

do you guys have a better example or tutorial.

0 likes
6 replies
haitam1's avatar

@mikevrind: thx for the resource.

@bestmomo : looks good and simple, but since my project is on a ftp server, I need to figure out how to install a package without composer

younus's avatar

Is there any way to resize the image based on the browser? When viewed on mobile, the images are not properly visible.

Snapey's avatar

Is there any way to resize the image based on the browser?

html 101 : <img src="image.jpg" width="200"> or use css, or resize server side on receipt, or on retrieval.

oh, @younus, and don't tag onto the end of very old threads

Please or to participate in this conversation.