I have a website made with Laravel and recently i have uploaded it on cPanel and now i have some problems;
First problem is that in localhost i can save images in public/images from website and delete them but on cPanel no longer i could upload images.
Second issue is that i have removed all the images in cPanel but still my website loads that old images.When i go to image url directory there is nothing! i don't know how is it possible.
This is the code i used to save images:
$image = $request->file("image");
$new_name = "image" . "_" . $lesson->id . "." . $image->getClientOriginalExtension();
$image->move(public_path('images/lessons'), $new_name);
And the code for show images:
src="{{asset('images/lessons/image_'.$lesson->id.".png")}}"
This is my local folder :
Below you can find my public_html folder :
I have a website made with Laravel and recently i have uploaded it on
cPanel and now i have some problems; First problem is that in
localhost i can save images in public/images from website and delete
them but on cPanel no longer i could upload images.
Could you explain this a little bit more detailed? Thank you.
Second issue is that i have removed all the images in cPanel but still
my website loads that old images.When i go to image url directory
there is nothing! i don't know how is it possible.
Sounds like Cache. Have you tried to empty your browser cache after deleting the images on your server? If they are gone, it was the Cache. A cache will/can expire after some amount of time, so that should not be an issue.
If you want to disable caching while debugging you can turn it off in your developer console. See this answer: Disabling Chrome cache for website development
I hope this helps.
Try renaming the image, and after you rename, access the link for the renamed image ( using the new name ).
ie. www.xyz.com/image2.png
And then try delete.
Related
I designed a web app by Laravel and deployed it on IIS windows server 2022.
this app uploads images correctly but it can't show them.
when I open the security tab on properties of uploaded images I see IISUSER doesn't exist in the permissions list. I change the permission list and add IISUSER to it and everything is ok. what should I do to resolve it?
laravel stores images in public folder only and not store in nested folders, so instead of storing image in public images\folder1\folder2\image.png you can directly store public folder/image.png in this way
try to move file something like this
path= $actuFile->move(public_path('folder'), $name);
and retrieve something like this
(asset("folder/{$imagName}")
This is worked for me.
if its work for you also then welcome in advance.
I solved the problem.
Php first uploads files to c:/windows/Temp then move them to laravel/public/uploadedFiles. I modified the permissions of the Temp folder and add IISUSER to the list. after that, I set full control permission to the IISUSER.
I am working on a project in which I am facing a problem with Profile image. I am using Windows 10 as a system and XAMPP (apache, mariadb, php) as a development tool.
I have created one profile.php page which simply shows user info and options for updating user information. When I want to display profile image, it will find the image in directory path="../img/user/alvis.jpg" and load it.
If I delete the alvis.jpg image from the directory, and I load the profile.php page then it will still display the image without any error.
What is going on?
Browser probably has that image cached.
In profile page make a check if image still exists. If not, display some default thumbnail.
Instead of alvis.jpg, use something unique when creating, updating profile images. For example, timestamp.
You can try this in Incognito Browser. Actually the image might be cached which is making the browser to load from local than from the actual source.
Just to be sure, check the names and path once again - In your code and in folders.
When I am uploading images in WordPress media. It shows error.
error showing: An error occurred in the upload. Please try again later.
And also any of the images is not showing.
Here I click to attched image to the page but there is no image
Not any of the images are showing here only wp loader is rotating.
This issue comes when I make a second copy of wordpress site on the same server. I have given Site URL and Home URL correctly and also given permission to the all the folder. Yet this issue not resolved. but other wordpress site is working fine on this server.
There are many reasons to do not upload images in your WordPress media library.
That might be the issue of permission of your directory or as you said you have given permission already then you should check you upload path.
There are also some other steps to check and solve your issue.
Please follow this link. It will guide you step by step process and hopefully work for you.
I have recently installed Magento and am using it for the first time. I am trying to uplaod an image to a folder as the new logo in the heading. When I upload the image using FTP the file uploads successfully but I can’t see it in the folder listing in a browser or on the website or if I visit the url for the image. I get a 404 page instead. Everything is getting cached I believe. I have turned off caching in the back end and cleaned out var/cache folder. This is a new one to me as I wouldn’t ahve thoughts ftp uploading an image would or could be cached? I can’t even change the header image on my website.
Im using the hellowired them as a starting point.
Cheers
Check the permissions on the Images and the directory it is in.
Can you verify that it is in the folder that you have uploaded it too?
Can you view it on server browsing the directories?
Finally check that you have type it correctly as Linux box's are CAPS sensitive, this could be why you can't see it also.
Looks like my host migrated my accounts to another server and I was actually updating the old hosting. Thanks for your help.
I'm using SilverStripe 3.0 and I need some help around here. I have a many to one relation between pages and images (I'm creating an image gallery). The images are uploaded into the right folder, but the CMS seems to save the wrong path for them. I'll explain a little more detailed:
I load the image in the uploader, it shows me a thumbnail while uploading. But when it finishes the upload the thumbnail disappears.
When I click the Edit button I see that it's looking for the image in the /assets folder (like /assets/picture.jpg), but it was uploaded to /assets/Uploads.
I tried setting a different upload folder using $FileField->setFolderName(), but it always looks for the images in /assets besides it uploads them in the right folder.
Any suggestion?
This was a known bug that should be fixed with the 3.0.4/3.0.5 release.