473,544 Members | 1,985 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Outlook .vcs files, working in everything but IE 6

3 New Member
I found a similiar topic on here, but it's different enough that I'm not quite able to figure out the problem I'm having here. Insert obligatory noob disclaimer.

I want to be able to add a "click to add to your Outlook Calendar" link to some pages for my company's site. I'm uploading .vcs files created in Outlook, and using some PHP (below) in an attempt to make it as intuitive as possible for end users.

It works in Firefox 1.5 and 2.0, in IE 7, and in Safari. But IE 6 will have absolutely none of it. It downloads the correct data, but as the .php file, opening it in the IE window as text instead of as an Outlook Calendar file like I want. I've been googling MIME types for an hour and trying every one I can find, with no success.

Please help me make IE 6 behave.

code:
Expand|Select|Wrap|Line Numbers
  1. <?php
  2.  
  3. $val = $_GET['event'];
  4.  
  5. header("Content-Type: application/octet-stream");
  6. header("Content-Length: " . filesize("archives/$val.vcs"));
  7. header('Content-Disposition: attachment; filename="archives/$val.vcs"');
  8. readfile("archives/$val.vcs");
  9. ?>
  10.  
Please be gentle with me :)
May 18 '07 #1
4 3874
pbmods
5,821 Recognized Expert Expert
Heya watchedpots. Welcome to TSDN!

Try using 'application/force-download' as your Content-type.
May 18 '07 #2
watchedpots
3 New Member
Thanks, good to be here.

Still having the same problem with force-download though. IE 6 downloads a file (with no extension) called "addcal" (addcal.php is the name of the script). The content of the file it downloads is actually the correct vcs data if i open it with notepad, but without that extention, the user's pc won't know to open it with Outlook.

Incidentally, when FF or IE 7 downloads the file, they name it $val.vcs, which is a litle weird but which i can live with because at least it's a vcs file and it has the right data.
May 21 '07 #3
pbmods
5,821 Recognized Expert Expert
Try adding this:

Expand|Select|Wrap|Line Numbers
  1. header('Content-disposition: attachment; filename=addcal.vcs' );
  2.  
So now we have:
Expand|Select|Wrap|Line Numbers
  1. header('Content-type: force-download');
  2. header('Content-disposition: attachment; filename=addcal.vcs' );
  3.  
May 21 '07 #4
watchedpots
3 New Member
Wow, it worked! Thanks so much, I really appreciate it.

FYI, it works with application/octet-stream as the Content-Type, which I went back to because FF seemed to think it was dealing with an mp3 file with force-download.
May 23 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

2
19311
by: Fritz Switzer | last post by:
Can anyone provide a small snippet in C# that pulls out the Contacts in Outlook XP. I've seen a couple of examples in C++ and VB in previous newsgroup posts, but either the originals didn't work or my conversion skills are weak. And if I have to use tlbimp.exe what is the right file to use. Thanks for the help. -- Fritz
3
5714
by: Kurt | last post by:
Hi We are developing an off-the-shelf software suite for a certain business sector. Most of the program is simply a GUI on top of some .mdb files. Its a .net application written in c# One major requirement is "Outlook Integration". The Outlook contact folders are to be used for contact management I want to know what is the standard way...
5
4316
by: tabonni | last post by:
Hello All I am creating an ASP page. There are a list of filename and checkbox next to it. When user checked all the documents they want and click ADD TO CLIPBOARD button. All filepaths will be copied into clipboard and then they can right-click -> paste into MS Outlook as attachments. How can I use clipboardData.setData function to do...
12
4695
by: Arno R | last post by:
Hi all, This is a repost of a message posted at october 6. The answer I got was about MapiMessages.AttachmentIndex. I think I need the MSMAPI32.OCX to use this. (I don't have this file on my PC) My newsaccount wasn't working anymore until yesterday, so I'll try again. Question is: I know it is possible to send email with Access, but...
2
6345
by: Kamyk | last post by:
Hello all! I have created a function in VB which generate appointment in Outlook. Everything is OK, except one thing. I cannot send it automatically using a button in Access, because I don`t know what is the code to send it automatically. I noticed that if I click on Calendar>"click on selected appointment">menu>Appointment>Invite Atendees...
1
1913
by: Peter Wullems | last post by:
I use C# to parse incoming emails for a predefined type and structure of message content and construct replies automatically, attach a file and place the generated emails in the drafts folder. There I can review and decide which ones to send. The program was working fine the other day and then decided to stop with the following message:...
2
5800
by: James | last post by:
Is it possible for me to generate Outlook objects in an ASP.NET application on a web server (like a calander event for example) and then attach that object to an email so that the recipient can open it and add a calander event to THEIR Outlook file? I already know how to send mail using the SmtpMail object. If it is possible, how difficult...
7
4917
by: John | last post by:
Hi I am using the following code to automate outlook from within MS Access; Dim O As Object O = CreateObject("Outlook.Application") The problem is that I am getting the following error on the second line; Automation error
4
6438
by: infomage27 | last post by:
I have tried scripting this with rules and VBA, now trying with C# but still failing. (code is exploratory, so please excuse the terribleness) maybe someone here will show me the error of my code... sending an email by hand - everything works as expected (rules, VBA, etc are all applied). sending an email from code (C#, external VBA,...
0
7424
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7607
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7376
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
5909
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5297
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
4918
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3409
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1841
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
988
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.