Page 1 of 2

Re: CGCalendar: File cannot be uploaded due to error

Posted: Wed Aug 18, 2010 8:15 am
by Peciura
What file you are trying to upload ?

Just a shot in the dark:
check if apache has write permissions on "/uploads/calendar"
check "Allowed file types" on CGCalendar settings tab, values might be case sensitive.
try uploading file with long name ( like 10-20 symbols).

It works in admin on CMSms 1.6.8 and CGCalendar 1.5.2

Re: CGCalendar: File cannot be uploaded due to error

Posted: Thu Dec 01, 2011 2:38 pm
by blackhawk
strange, I'm getting this problem with cmsms 1.10.1 on my live web hosting site. I did all the steps you mentioned, but still getting no love...

The calendar folder I created within my uploads directory even has a 777 permission set to it for testing purposes and still nothing. And it doesn't matter what file type it is...

Code: Select all

ERROR: A Problem occurred when copying the file to its final destination (Troubleshooting)

Re: CGCalendar: File cannot be uploaded due to error

Posted: Mon Apr 23, 2012 11:47 am
by Rolf
Use for the field "Directory where file uploads should be placed" the full root_path to the folder.

grtz. Rolf

Re: CGCalendar: File cannot be uploaded due to error

Posted: Tue Aug 27, 2013 5:29 pm
by pixelita
I am having this problem as well. I have been able to successfully use custom fields in the News Module.

I get that same error when trying to use images and thumbs in the CGCalendar module.

Here is a sample of my template code.

Code: Select all

<!-- CGCAL UPCOMING EVENT LIST -->
{foreach from=$events key=key item=event}
<div class="eventlist">
<div class="NewsSummary">
<div class="newsthumb">
<img src="/uploads/images/id{$entry->id}/{$entry->event_thumb}" alt="{$entry->title}" width="111" />
</div>
<div class="news_summ_right">
<h2 class="NewsSummaryLink"><a href="{$event.url}">{$event.event_title}</a></h2>
{assign var=month_number value=$event.event_date_start|date_format:"%B %e, %Y"}
<p class="NewsSummaryPostdate"><span class="calendar-date-title">{$lang.date}: </span>{$event.event_date_start|date_format:"%B %e, %Y"} {$month_names[$month_number]}</p><!-- /NewsSummaryPostdate -->
{if $event.event_summary !=""}
<p class="NewsSummarySummary">{$event.event_summary}</p><!-- /NewsSummarySummary -->
{/if}
{* optionally display detail information 
{if $event.event_details !=""}
<div class="NewsSummaryContent">{$event.event_details}</div><!-- /NewsSummary Content -->
{/if}
 *}
<p class="more"><a href="{$event.url}">{$mod->Lang('cal_more')}</a></p>
</div><!-- /news_summ_right -->
<div class="clearer"></div>
</div><!-- /eventlist -->
{/foreach}

{if $return_url != ""}
<div class="calendar-returnlink">{$return_url}</div>
{/if}
This is the string I am using to call the image thumbnail for the event listing (which should display similarly to the news items on the front page of the site here: http://www.idylwood.org ...

Code: Select all

<img src="/uploads/images/id{$entry->id}/{$entry->event_thumb}" alt="{$entry->title}" width="111" />
The path to the image folder is /home/username/public_html/uploads/images/

I have tried using the trailing slash and not using the trailing slash.

I saw this closed bug report that suggests the problem is the result of a botched site migration, but that shouldn't be the case here since the site has been on this server from inception.
http://dev.cmsmadesimple.org/bug/view/9130

Any ideas?

Re: CGCalendar: File cannot be uploaded due to error

Posted: Tue Aug 27, 2013 7:25 pm
by Dr.CSS
I keep thinking this is not the way to call fields, entry->event_thumb, I would put {get_template_vars} in to make sure entry->event_thumb is available...

Re: CGCalendar: File cannot be uploaded due to error

Posted: Tue Aug 27, 2013 8:16 pm
by pixelita
I am not the "Smarty-est" tool in the shed when it comes to this. I know just enough about code to be dangerous.

Would this work?

Code: Select all

<div class="newsthumb">
<img src="/uploads/images/{get_template_vars}" alt="{$entry->title}" width="111" />
</div>

Re: CGCalendar: File cannot be uploaded due to error

Posted: Tue Aug 27, 2013 8:59 pm
by velden
That would be an interesting exercise...

http://docs.cmsmadesimple.org/troublesh ... plate_vars

I often use the {debug} tag in templates. You need to have popups enabled. It's shows a window with useful information about smarty objects/variables.

Re: CGCalendar: File cannot be uploaded due to error

Posted: Tue Aug 27, 2013 9:24 pm
by pixelita
I used that code successfully when uploading images to the news module so logic would dictate that it should work in the calendar module as well. That link to the bug report however doesn't give me much hope. I may blow off the images in the calendar. They aren't essential.

Re: CGCalendar: File cannot be uploaded due to error

Posted: Wed Aug 28, 2013 4:23 pm
by Dr.CSS
That would be at the bottom of the calendar template to tell you what is available...

Re: CGCalendar: File cannot be uploaded due to error

Posted: Wed Aug 28, 2013 5:04 pm
by pixelita
Okay, I put that tag in the bottom of the problematic event-list template, made it the default template, and loaded the page:

http://idylwood.org/calendar/event-list/

Seems like it's picking up stuff from the news and weather module too. :(

What am I doing wrong here?

Re: CGCalendar: File cannot be uploaded due to error

Posted: Wed Aug 28, 2013 5:18 pm
by Jo Morg
pixelita wrote:Seems like it's picking up stuff from the news and weather module too. What am I doing wrong here?
Your not doing anything wrong. That's as designed... You just don't know what to look for or how to interpret when you find it :)
I'm not sure but in your list of available smarty variables events should be the one with the calendar list of events, so to peek on it's content try

Code: Select all

{$events|@print_r}

Re: CGCalendar: File cannot be uploaded due to error

Posted: Wed Aug 28, 2013 6:17 pm
by pixelita
Well I went ahead and crammed all of those helpful tags in there, the debug, get_template_cars, event print, and this is what I see:
http://idylwood.org/calendar/event-list/

Looks like my two custom fields are nowhere to be found (they are "event_image" and "event_thumb"). Screendump attached.

Re: CGCalendar: File cannot be uploaded due to error

Posted: Wed Aug 28, 2013 6:50 pm
by Dr.CSS
I wouldn't have used the same prefix as all the other fields, you may need to use the {$event|@print_r} note the lack of the s as the other is just giving you a 1 at the bottom...

Re: CGCalendar: File cannot be uploaded due to error

Posted: Wed Aug 28, 2013 7:02 pm
by velden
Well, I installed CGCalender and created a file upload field named 'event_image' and it just seems to work:

Code: Select all

{cms_module module="CGCalendar" display="upcominglist"}

Code: Select all

Smarty_Variable Object (3)
->value = Array (1)
  0 => Array (20)
    event_id => "1"
    event_title => "test 1"
    event_summary => "Testing 1"
    event_details => "This is test 1"
    event_date_start => "2013-09-28 20:45:00"
    event_date_end => null
    event_parent_id => "-1"
    event_recur_period => "none"
    event_date_recur_end => null
    event_created_by => "-101"
    event_create_date => "2013-08-28 20:54:01"
    event_modified_date => "2013-08-28 20:54:01"
    event_recur_nevents => "-1"
    event_recur_interval => "1"
    event_recur_weekdays => ""
    event_recur_monthdays => ""
    event_allows_overlap => "1"
    url => "http://www.mydomain.nl/calenda..."
    fields => Array (1)
      event_image => "brand.jpg"
    categories => Array (0)
->nocache = false
->scope = "module_db_tpl:CGCalendar;upcominglist..."
There really seems to be a problem with your installation.

Re: CGCalendar: File cannot be uploaded due to error

Posted: Wed Aug 28, 2013 7:10 pm
by pixelita
I suppose that has to be the answer and it's probably the answer to a lot of other problems on this site, despite the fact that it's running the latest version of CMSMS and all modules. TwitterFeed doesn't work; the new and updated Bookmarks doesn't work, etc., etc., etc.

I changed the field names to "image_for_event" and "thumb_for_event" and here's what I get. The area [fields] should not be empty, I don't believe:

Code: Select all

 [fields] => Array
                (
                )

            [categories] => Array
                (
                    [East End Events] => 1
                )