diff options
author | Sterling Hughes <sterling@php.net> | 2001-12-03 09:19:14 +0000 |
---|---|---|
committer | Sterling Hughes <sterling@php.net> | 2001-12-03 09:19:14 +0000 |
commit | fa58a950356c12c6f6eb481e8350b27890295758 (patch) | |
tree | ffe1e554e0e21db607e2aa777ec3aa3923dd355e | |
parent | 734708319f767062584370c1c95952266d400160 (diff) | |
download | php-git-fa58a950356c12c6f6eb481e8350b27890295758.tar.gz |
Re-add support for HTTP file uploads
-rw-r--r-- | ext/curl/curl.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/ext/curl/curl.c b/ext/curl/curl.c index 26bdd73a3b..977eae470f 100644 --- a/ext/curl/curl.c +++ b/ext/curl/curl.c @@ -791,9 +791,16 @@ PHP_FUNCTION(curl_setopt) convert_to_string_ex(current); zend_hash_get_current_key_ex(postfields, &string_key, &string_key_len, &num_key, 0, NULL); - - error = curl_formadd(&first, &last, CURLFORM_COPYNAME, string_key, - CURLFORM_PTRCONTENTS, Z_STRVAL_PP(current), CURLFORM_END); + + postval = Z_STRVAL_PP(current); + if (*postval == '@') { + error = curl_formadd(&first, &last, CURLFORM_COPYNAME, string_key, + CURLFORM_FILE, ++postval, CURLFORM_END); + } + else { + error = curl_formadd(&first, &last, CURLFORM_COPYNAME, string_key, + CURLFORM_PTRCONTENTS, postval, CURLFORM_END); + } } if (error != CURLE_OK) { |