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

curl-and-php

Root directory for uploading files

From: Rikki Prince <rfp07r_at_ecs.soton.ac.uk>
Date: Wed, 16 Mar 2011 18:36:14 -0000

Hi everyone,

I have some PHP code which uploads a file to a REST interface using
libcurl (@ before the file name in CURLOPT_POSTFIELDS). I was using a
relative path to point to the file, which worked fine on the Mac I was
developing on. However, when I deployed it to a Windows machine it didn't
work.

A bit of debugging later, I found that rather than relative to the
directory the PHP script is in, or even the document root, libcurl was
looking for the file in the server root (C:\apache in my case). Of
course, I was being stupid, it tells me to use the full path here:
http://php.net/manual/en/function.curl-setopt.php

However, I was wondering if there is a reason for this inconsistency
between libcurl on Mac and Windows? Have I just messed up my server
config or is this a known bug?

Cheers,
Rikki

-- 
= Rikki Prince =
_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
Received on 2011-03-17