从 web .vcs 下载将日历事件添加到 Android [英] Add Calendar event to Android from web .vcs download

查看:24
本文介绍了从 web .vcs 下载将日历事件添加到 Android的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前的问题如下;我正在创建一个网站,其中包含两个供下载的文件(.vcs 和 .ics),一旦单击相应的链接,就会将事件添加到设备日历中.对于 iPhone 中的 .ics,我没有问题.我的问题是,在 Android 中下载 .vcs 文件时,它只会打开一个显示 .vcs 文件内容的空白页面,但不会下载它,也不会将文件识别为日历事件.

my current problem is the following; I am creating a website with two files for download(.vcs and .ics) that will add an event to the device calendar once clicked on the respective link. For the .ics in the iPhone I have no problem. My issue is that when downloading the .vcs file in Android it just opens a blank page showing the .vcs file content but is not downloading it neither recognizing the file as a calendar event.

我认为根据我之前在 SO 中读到的内容(我正在寻找那个线程,但现在找不到它来参考)这与 mime 类型有关,但在尝试弄清楚怎么做,我不能让它工作.

I think as per what I read before in SO (and I was searching for that thread but could not find it now to reference) that has something to do with the mime type but after trying to figure out how to do it I cant make it work.

在该线程中,他们还指向 vcs 文件适用于 Android 的网站,因此可以这样做(我读了很多帖子说这是不可能的,除非你从 google play 下载日历应用程序);http://plone.org/events/community/plone-conference-2011

In that thread also they point to a site where the vcs file works for Android so is possible to do (I read many posts saying is not possible unless you download a calendar app from google play); http://plone.org/events/community/plone-conference-2011

我检查了该页面的源代码,我想知道他们是否在服务器端做某事如果您能帮我指出要遵循的方向或可行的解决方案或您可能对此提出的任何建议,我将不胜感激.

I inspected that page source code and I am wondering if is something they are doing in the server side If you could please help me pointing out a direction to follow or a working solution or any advice you may have about it I will be thankfully.

PD - 这是我在 SO 中的第一个问题!

PD - Is my first question in SO!

推荐答案

终于可以用这个index.php添加一个指向位置的链接

Finally got it working adding a link to a location with this index.php

<?php
header("Content-Type: text/x-vCalendar");
header("Content-Disposition: attachment; filename=london2012.vcs");
?>
BEGIN:VCALENDAR
PRODID:-//AT Content Types//AT Event//EN
VERSION:2.0
METHOD:PUBLISH
BEGIN:VEVENT
DTSTAMP:20120801T133822Z
CREATED:20120801T042948Z
LAST-MODIFIED:20120801T043003Z
SUMMARY:Olympic Games
DTSTART:20120727T000000Z
DTEND:20120812T000000Z
LOCATION:London
URL:http://www.london2012.com/
CLASS:PUBLIC
END:VEVENT
END:VCALENDAR

然后它会从 Android 下载文件,您可以将其导入日历.希望对其他人有用...

Then from Android it downloads the file and you can import it to the calendar. Hope is usefull for someone else...

这篇关于从 web .vcs 下载将日历事件添加到 Android的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆