21307 Posts in 5737 Topics by 2603 members
General Questions
SilverStripe Forums » General Questions » [SOLVED] Problem Attaching Image on Custom Page from tutorial
General questions about getting started with SilverStripe that don't fit in any of the categories above.
Moderators: martimiz, Howard, Sean, Ryan M., biapar, Willr, Ingo, swaiba, simon_w
|
Page:
1
|
Go to End | |
| Author | Topic: | 928 Views |
-
[SOLVED] Problem Attaching Image on Custom Page from tutorial

10 December 2010 at 6:29pm
Hi,
I can't seem to upload an image to the "Staff" page type created in the tutorial. When I go to the "Images" tab and choose to attach an image from my computer, it does not show up in the admin or on the page. If I choose to attach something uploaded to the file store, it works. Can someone please tell me how to fix this or what I should be looking for? I'm using version 2.4.3
Thank you!
-
Re: [SOLVED] Problem Attaching Image on Custom Page from tutorial

10 December 2010 at 9:06pm
If you attach the file from your computer does it upload to the assets/ folder successfully? i.e when you use select from file system you can see your image. If it doesn't upload then a couple things to check
* Permissions on your assets/ folder. Web server needs read / write access to upload files
* Check the extension of the image is valid (eg png, gif
* Ensure the files not too big (can you upload small files?) -
Re: [SOLVED] Problem Attaching Image on Custom Page from tutorial

11 December 2010 at 9:03am
Hi Will,
Thank you for the response! I can upload things to the assets folder from the files/images tab just fine. That's why I thought this is really weird, maybe there is a problem with my page type but I followed the tutorial word for word, maybe I missed something? I have the "images" tab in the page type, it just does not let me attach an image "from my computer". If I go to files/images and upload the image first, and then choose to attach an image "from the file store" I am fine.
-
Re: [SOLVED] Problem Attaching Image on Custom Page from tutorial

11 December 2010 at 9:26am Last edited: 11 December 2010 9:27am
p.s. I seem to have the same problem from another page type I created, a Flash page type using swfobject from this tutorial:
http://www.ssbits.com/tutorials/2009/embed-flash-content-using-swfobject/
I can't attach the SWF from my computer, but if I upload to the file store first it works. Thanks for any help or pointers...
-
Re: [SOLVED] Problem Attaching Image on Custom Page from tutorial

12 December 2010 at 9:31am Last edited: 12 December 2010 9:53am
Please, anyone know about this or have any ideas? Here is what I have for mt StaffPage code:
<?php
class StaffPage extends Page {
static $db = array(
);
static $has_one = array(
'Photo' => 'Image'
);function getCMSFields() {
$fields = parent::getCMSFields();$fields->addFieldToTab("Root.Content.Images", new ImageField('Photo'));
return $fields;
}
}class StaffPage_Controller extends Page_Controller {
}
?>So I get the image tab in the Admin, but it does not upload the photo or attach the image. I'd really like to get this fixed. Thank you for any suggestions.
-
Re: [SOLVED] Problem Attaching Image on Custom Page from tutorial

14 December 2010 at 6:37am
Does anyone have any idea here? I've looked but I can't really see what might be happening. At this point I would just like to know if I am doing something wrong or if it is a bug in the CMS. Is there a way for me to debug this?
-
Re: [SOLVED] Problem Attaching Image on Custom Page from tutorial

15 December 2010 at 12:37pm
This is solved and was an issue on my end. I had proper permissions on the assets folder, thus I could upload to assets from Files & Images tab, but the Uploads folder inside the assets folder did not have proper permissions. The custom page types try to upload to assets/Uploads which is why it was failing.
| 928 Views | ||
|
Page:
1
|
Go to Top |


