cURL / Mailing Lists / curl-and-php / Single Mail

curl-and-php

PHP, cURL, uploading file and mime-type (content-type)

From: PERIE Vincent Ext ROSI/DPS <vperie.ext_at_orange-ftgroup.com>
Date: Fri, 9 Nov 2007 09:19:06 +0100

Hi,
 
I have an issue using libcurl for uploading files. The problem is when
I'm trying to set another Content-Type or Mime-Type for the uploaded
file, this is always the String "application/octet-stream" that is
sended. So I don't know how I can do this. See the http capture below :
 
[...]
Content-Type: multipart/form-data;
boundary=----------------------------d27d2e693e9c
------------------------------d27d2e693e9c
Content-Disposition: form-data; name="FILENAME" test.ics
------------------------------d27d2e693e9c
Content -Disposition: form-data; name="file"; filename="
/home/user/MyProject/www/uploads/vtoaq4922007110808243.ics "
Content-Type: application/octet-stream
[...]
 
How can I set manually the Content-Type of a file I want to upload ? for
example "text/calendar" ?
 
Thx a lot.
 
Vincent P.
 
 

*********************************
This message and any attachments (the "message") are confidential and intended solely for the addressees.
Any unauthorised use or dissemination is prohibited.
Messages are susceptible to alteration.
France Telecom Group shall not be liable for the message if altered, changed or falsified.
If you are not the intended addressee of this message, please cancel it immediately and inform the sender.
********************************

_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
Received on 2007-11-09