easy:SetOpt_SeekFunction(seek_callback[, userdata])
The function receives two arguments: The first argument specifies the offset to seek to, the second argument specifies the origin of the offset passed in the first argument. This will be one of the following special strings:
get
cur
end
If you pass the optional userdata
argument, the value you pass in userdata
will
be passed to your callback function as a third parameter. The userdata
parameter
can be of any type.
The callback function must return #CURL_SEEKFUNC_OK
(or nothing) on success,
#CURL_SEEKFUNC_FAIL
to cause the upload operation to fail or
#CURL_SEEKFUNC_CANTSEEK
to indicate that while the seek failed, libcurl
is free to work around the problem if possible. The latter can sometimes be
done by instead reading from the input or similar.