From b60e0fa97ed7ddc66d0ad6d00dfd78319bb6ad36 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 5 Jan 2004 22:29:29 +0000 Subject: David J Meyer's large file support. --- docs/examples/ftpupload.c | 2 +- docs/examples/httpput.c | 5 ++--- docs/libcurl-the-guide | 4 ++-- docs/libcurl/curl_easy_setopt.3 | 22 +++++++++++++++++++--- 4 files changed, 24 insertions(+), 9 deletions(-) (limited to 'docs') diff --git a/docs/examples/ftpupload.c b/docs/examples/ftpupload.c index 2ac874537..d51e43c4d 100644 --- a/docs/examples/ftpupload.c +++ b/docs/examples/ftpupload.c @@ -73,7 +73,7 @@ int main(int argc, char **argv) curl_easy_setopt(curl, CURLOPT_READDATA, hd_src); /* and give the size of the upload (optional) */ - curl_easy_setopt(curl, CURLOPT_INFILESIZE, file_info.st_size); + curl_easy_setopt(curl, CURLOPT_INFILESIZE_LARGE, file_info.st_size); /* Now run off and do what you've been told! */ res = curl_easy_perform(curl); diff --git a/docs/examples/httpput.c b/docs/examples/httpput.c index 48c9f70ec..3b3fac136 100644 --- a/docs/examples/httpput.c +++ b/docs/examples/httpput.c @@ -85,9 +85,8 @@ int main(int argc, char **argv) /* now specify which file to upload */ curl_easy_setopt(curl, CURLOPT_READDATA, hd_src); - /* and give the size of the upload, make sure that we don't accidentally - pass a larger variable type than "long". */ - curl_easy_setopt(curl, CURLOPT_INFILESIZE, (long) file_info.st_size); + /* and give the size of the upload */ + curl_easy_setopt(curl, CURLOPT_INFILESIZE_LARGE, file_info.st_size); /* Now run off and do what you've been told! */ res = curl_easy_perform(curl); diff --git a/docs/libcurl-the-guide b/docs/libcurl-the-guide index ba0489179..3eeafc927 100644 --- a/docs/libcurl-the-guide +++ b/docs/libcurl-the-guide @@ -298,9 +298,9 @@ Upload Data to a Remote Site A few protocols won't behave properly when uploads are done without any prior knowledge of the expected file size. So, set the upload file size using the - CURLOPT_INFILESIZE for all known file sizes like this[1]: + CURLOPT_INFILESIZE_LARGE for all known file sizes like this[1]: - curl_easy_setopt(easyhandle, CURLOPT_INFILESIZE, file_size); + curl_easy_setopt(easyhandle, CURLOPT_INFILESIZE_LARGE, file_size); When you call curl_easy_perform() this time, it'll perform all the necessary operations and when it has invoked the upload it'll call your supplied diff --git a/docs/libcurl/curl_easy_setopt.3 b/docs/libcurl/curl_easy_setopt.3 index ac3408471..be50940db 100644 --- a/docs/libcurl/curl_easy_setopt.3 +++ b/docs/libcurl/curl_easy_setopt.3 @@ -602,6 +602,9 @@ techniques). .IP CURLOPT_RESUME_FROM Pass a long as parameter. It contains the offset in number of bytes that you want the transfer to start from. +.IP CURLOPT_RESUME_FROM_LARGE +Pass an off_t as parameter. It contains the offset in number of bytes that you +want the transfer to start from. .IP CURLOPT_CUSTOMREQUEST Pass a pointer to a zero terminated string as parameter. It will be user instead of GET or HEAD when doing a HTTP request, or instead of LIST or NLST @@ -628,16 +631,29 @@ output. This is only relevant for protocols that have separate header and body parts. On HTTP(S) servers, this will make libcurl do a HEAD request. .IP CURLOPT_INFILESIZE When uploading a file to a remote site, this option should be used to tell -libcurl what the expected size of the infile is. +libcurl what the expected size of the infile is. This value should be passed +as a long. See also \fICURLOPT_INFILESIZE_LARGE\fP. +.IP CURLOPT_INFILESIZE_LARGE +When uploading a file to a remote site, this option should be used to tell +libcurl what the expected size of the infile is. This value should be passed +as an off_t. .IP CURLOPT_UPLOAD A non-zero parameter tells the library to prepare for an upload. The -\fICURLOPT_READDATA\fP and \fICURLOPT_INFILESIZE\fP are also interesting for -uploads. +\fICURLOPT_READDATA\fP and \fICURLOPT_INFILESIZE_LARGE\fP are also interesting +for uploads. .IP CURLOPT_MAXFILESIZE Pass a long as parameter. This allows you to specify the maximum size (in bytes) of a file to download. If the file requested is larger than this value, the transfer will not start and CURLE_FILESIZE_EXCEEDED will be returned. +NOTE: The file size is not always known prior to download, and for such files +this option has no effect even if the file transfer ends up being larger than +this given limit. This concerns both FTP and HTTP transfers. +.IP CURLOPT_MAXFILESIZE_LARGE +Pass an off_t as parameter. This allows you to specify the maximum size (in +bytes) of a file to download. If the file requested is larger than this value, +the transfer will not start and CURLE_FILESIZE_EXCEEDED will be returned. + NOTE: The file size is not always known prior to download, and for such files this option has no effect even if the file transfer ends up being larger than this given limit. This concerns both FTP and HTTP transfers. -- cgit v1.2.3