问题
Assume I have some controller "Controller" and public method in it:
public ActionResult GetICal(int? param1, int? param2)
{
string cal = "";
//some logic goes here
return File(Encoding.UTF8.GetBytes(cal), "text/calendar", "calendar.ics");
}
Then I'm trying to export it to Google Calendar via url: https://my.site.com/controller/getIcal?param1=0¶m2=1
And then nothing happens. Once i've got message like "Can't fetch url" (or simething like that).
I don't know, what I'm doing wrong. This url is 100% accessible without authorization. And if I'm adding this calendar via file, everything is going ok (so calendar has correct format).
回答1:
I have the same problem now - what I had to change, and what is the problem as I see it, is parameters in my url. With any parameters it always end up with error message "Can't fetch url".
But when I used google URL shrinker, and added calendar as this shrinked URL, like http://goo.gl/XXXXX, it worked on first try.
回答2:
What type of SSL certificate has your server? Self-signed? We had similar issue:
- when we used normal "http", iCal feed was imported correctly
- when we used "https" with self-signed certificate, Google Calendar did not import the feed, but with goo.gl service as mentioned ppetak it was OK
- when we used "https" with Class 2 certificate verified by GoDaddy.com, situation was same as in 2)
- when we used "https" with Class 3 certificate verified by VeriSign everything works properly
来源:https://stackoverflow.com/questions/19764216/google-calendar-cant-import-my-ical-file