Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Archive

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, biapar, Willr, Ingo, simon_w

Image not shown on pages and in administraton


Reply

18 Posts   6901 Views

Avatar
nomen

12 September 2008 at 8:49pm (Last edited: 12 September 2008 8:51pm), Community Member, 52 Posts

Hi:

Maybe [url=http://www.silverstripe.com/site-builders-forum/flat/9740?showPost=168909/]this[/url] is usefull for you. I have similar problems and that solves them.

bye

Avatar
jcostian

16 September 2008 at 6:49pm (Last edited: 16 September 2008 6:57pm), Community Member, 2 Posts

Hi,

I had propably the same problem. The upload worked fine but even when I had changed the folder permissions the new uploaded file had only owner rw permissions and it didn't show in the internet. The resampling worked, but the original image could not be used. The owner was the same than the owner of the whole web folder.

I was able to fix this by adding one line of code to Folder.php in sapphire/filesystem.
In method addUploadToFolder I added chmod-command inside this if:

if(file_exists($tmpFile['tmp_name']) && copy($tmpFile['tmp_name'], "$base/$file")) {
// Update with the new image
chmod("$base/$file", 0755);
return $this->constructChild(basename($file));
}