Image not being deleted after actual deletion in xampp - php

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.

Related

PHP Image Upload - Locked Photos - FTP Error

I've been creating a website in the same way that I usually so, where I add an article + image using HTML & PHP. The difference is that when I upload the photo, even though it displays on the web page, my folder shows an Icon instead of the image (See Below):
As the photos show on the webpage I didn't think much of it, until I tried to upload the website, where I kept getting an FTP upload error on the images. Then when loading the website, I found that none of the images were there.
I'm not sure what the problem is, but when I tried to open one of the photos in Fireworks it says, "Could not open the file. File is locked".
Does anyone know what the probelm is? I'm using the same upload method used previously.

Uploading an image via IIS inherits ReportServer permission and the file appears broken

I am using a PHP based application called CiviCRM which allows us to upload images via the KCFinder image uploader. The server is a Windows 2012 RS with IIS 8. The image gets uploaded correctly and also shows in the preview. However, Once I click away from the preview the image appears broken on the page. Even going to the URL on the browser shows the image broken. I tried the same thing for PDFS and same issue. If I login to the server and check the pdf and image it shows that it is uploaded correctly and I can even click on it. I checked further and there seems to be a user group called ReportServer. I tried searching for this group but could not find it. If I change the permission of this group to write or anything else it fixes the issue. Does anyone have any ideas?inherited permissions

Laravel showing deleted files also

I have created a simple upload form which resizes, encode to jpg (with help of intervention) and uploads the image to the directory public/profilepics/user['id']/profile.jpg.
Next I created a simple function delete to delete the picture from above mentioned directory.
The upload form also show the current profile.jpg in the respective folder. But when I have successfully deleted the picture(I confirmed by looking into the public/profilepics directory in file browser), I still see the old picture. After uploading another image, again I see the old image only.
Do laravel have remembering capability or have internal cache(I am not talking about the cache service include in laravel This one) which should be cleared to see the new image.
Actually I was working on updating profile picture page and encountered this problem.
Leave the comment if any of the file is needed.

Broken png image using Laravel Asset Pipeline despite 200 OK status

I'm using Codesleeve/asset pipeline on my Laravel project to serve css, js and image files. It on the whole works fine but there is an issue with displaying css-loaded images. The image does not display and shows the browser's "broken image" symbol when loading it directly (http://art.ipscap.com/assets/select2.png for example): e.g.
Upon inspecting the page it shows the image is loaded successfully with 200 OK status (or cached) but there seems to be an error displaying it. Seeing as the image in question displays fine on my local machine and the problem is only in production is there a way to diagnose this issue?
Edit: Still haven' t managed to find a solution for this. For reference the live broken image url is https://art.ipscap.com/assets/select2.png. The image itself is in app/assets/images/select2.png and the readme in the same directory states:
If you place an image here called foobar.png then you can access that image by going to http://<hostname>/assets/foobar.png
I find it strange as the image does not fail to load but is being broken by asset pipeline. The same does not seem to occur to other images in the app such as the header jpeg image.
Do you use different server software on your local and production server? I see the production uses nginx. In that case, you might have to add something to your config as stated here:
https://github.com/CodeSleeve/asset-pipeline#can-i-use-nginx

Getting a 404 on images uploaded using FTP in Magento

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.

Categories