Uploading multiple images in SilverStripe 3.0 - php

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.

Related

Images not displaying in wordpress

So for some reason my images are just showing a broken image icon when I open my website from the adminpanel in WP. But when I open the index.php file the images are showing just as I want them to. Same with my javascript.
I have linked the image directory correctly since they are showing up when I only open the index.php file. They are also in the media library in wordpress.
Maybe a simpler explanation is:
localhost/website/wordpress = no images, only broken image icons.
localhost/website/wordpress/wp-content/themes/mywebsite/index.php = the images are showing.
EDIT: I found out you could copy the link that wordpress gives you for every image, and that made it work.
Is that the only way of doing it or is there another way?
Check is your .htaccess file for rules applied to images or image folder. Rename it to be sure
Remove image related wordpress plugins like "Adaptive Images"
It may due to file accessibility permission issue. Just give permission to your image folder. check your .htaccess file (on root).
Install a file browsing plugin or directly go to the hosted site and edit the .htaccess file. Add the folder name on the file

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.

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.

Force Wordpress media library to index files uploaded from ACF file upload field

I've created an ACF file upload field, in order to attach pdf and image files to each post I create.
the problem is, when I want to Re-Use those files - they don't appear in the media library, but they do appear in the "uploads" folder on the server.
Is there a way to force the media library to index those files?
They certainly should be appearing in the media library so it sounds like a configuration issue. Are there any errors appearing when you upload the file? Perhaps also check your server logs to make sure there is nothing being reported when you try and upload the file...

Image gallery loading images from an external server

I am trying to make a php image gallery where the script has to the following things:
Connect to external server (http/ftp)
scan directory "highres"
load images from directory "lowres" with same image name.
save low-res images on local folder
Show low-res images in gallery
Download button for the high-res image
Can anyone point me into the right direction cause i dont know where to start.
Take a look at FTP with PHP and start with reading out the files in the Folder FTP Documentation
Then use ftp_get() to download the first Image and resize it with help of the GDlib, here is a tutorial for a thumbnailing function. Or download all images at once and resize them all at once.
Now you are at the last step just show your thumbnail and link to the high-res images.

Categories