Issue with displaying uploaded images in Laravel 4.2 - php

I have had an issue with displaying uploaded images in my laravel application. The problem is, i had a directory in my public folder named uploads and this is where i stored uploaded images.
This displays images fine on my localhost but on my liveserver, the images don't display but when i saved the images this way public/images/uploads i.g. moving the uploads folder into the images folder the images display on the liveserver.
I have saved the image link in my database like so uploads/imagename.ext and i display it in the browser like so
<img class="img-responsive" src="images/{{($pgIndex->introTextImgLink)}}" style="width:100%; height:250px;"/>
The uploads folder has file permission 707. I really like to keep storing my uploaded images in the public/uploads folder but i am not sure what i could be doing wrong on my live server.

Related

Laravel 8 not showing new images

I have my Laravel 8 project on a shared hosting which uses cPanel. Uploaded my files and database with some records, for old records website displays all the images, but when I upload new images they're not showing up, photos are uploading on a storage folder, but not showing up.
HTML code:
<img src="/storage/{{ $post->photo}}"/>
This is a link to a stored images:
https://website.com/storage/images/
PostController image upload:
$image = $request->file('photo')->store('images', 'public');
Any suggestions?
Found a solution from here:
laracasts.com
Solution is to delete the "STORAGE" folder if exists, then run this command line:
php artisan storage:link

how to show images in another script after uploading it via a php script to a mysql database?

After creation a addscore.php script i uploaded images to mysql database via a form and move those images via move_uploaded_file() function. i can see those image files in my www file in my server. i created a uploads folder in which those images are moving to. Now i am trying to show those image in a different website using,
echo '<img src="uploads/'.$row['screenshot'].'" alt="score image"/>';
But the images are not showing.....
can anyone help me with this?????

Wordpress renames files when no duplicate is found

I have code that relies upon a certain file naming convention. When I stopped working locally and made a new database and setup online and went to upload the images for the posts. Wordpress adds a -1 or -2 to my images even though it is a fresh db and fresh wordpress install.
The naming conventions I have are like so..
cover_somename.jpg
cover_somename_bg.jpg
Why would it make my files like cover_somename_bg-1.jpg when there are NO DUPLICATES in the media library. How can I turn this renaming feature off/ rename the files myself.
When you upload image on local it will create move image to upload folder. And while you moving project to live you create new data base you have only remove the image name from the data base table.
But you image still remain on Upload folder under the month folder that you have added
When you upload the same file name on live server on same month then it will check for "if file already exist or not if already exist then it will rename new uploaded file as you get.
you create new data base so you old image wouldn't display on admin so you need to clear the folder under the upload folder then it work fine please try once.
Ah images aren't in the DB turns out they are in uploads folder and if the uploads folder has images but its a fresh install the media library will be empty but will act like it has those files and renaming will occur.

Apache can't display some images in same folder

I have more than 4500 images uploaded in the same folder. I'm uploading images with a php script. It was working fine but today i can't see images on web browser.
I can see a.jpg but i can't see b.jpg. All files have same size (3MB), same type (jpeg) and same access (644).
I tried to download the image to my disk with FTP. I can see on my mac. But i can't see on web browser.

Uploading multiple images in SilverStripe 3.0

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.

Categories