I'm working on my Joomla-Dropbox Extension: http://www.individual-it.net/en/Joomla/
The extension loads files up to dropbox via cURL. It does it via:
Code: Select all
$data = array('file' => '@/home/user/test.png');
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
sometimes is like this:
Code: Select all
------------------------------7d196756d9cb
Content-Disposition: form-data; name="file"; filename="a-1.txt"
Content-Type: text/plain
aaaaaaaaaaaaa
------------------------------7d196756d9cb-- -Linux Rechner1-Ubuntu 2.6.31-22-generic #67-Ubuntu SMP Sat Oct 16 19:10:07 UTC 2010 i686
-cURL Information: libcurl/7.19.5 OpenSSL/0.9.8g zlib/1.2.3.3 libidn/1.15
and sometimes like this:
Code: Select all
------------------------------b972a959726a
Content-Disposition: form-data; name="file"; filename="/home/users/clevoftp/cleverinsert.com/tmp/a-1.txt"
Content-Type: application/octet-stream
aaaaaaaaaaaaa
------------------------------b972a959726a-- - Linux web5 2.6.32-3-686-bigmem #1 SMP Thu Feb 25 06:54:30 UTC 2010 i686
- cURL Information: 7.18.2
because of the different filename (with and without path) I got different signature. I could manage both variants, but I have to be sure that every server send the data in the same way.
Can I force PHP to use the one or the other method?
Or how should I know what way is used?