def form_add(name, content)
def form_add(name, content)
case content
when Array
Curl.formadd(first, last,
:form_option, :copyname, :pointer, name,
:form_option, :namelength, :long, name.bytesize,
:form_option, :file, :string, content[2],
:form_option, :filename, :string, content[0],
:form_option, :contenttype, :string, content[1],
:form_option, :end
)
else
Curl.formadd(first, last,
:form_option, :copyname, :pointer, name,
:form_option, :namelength, :long, name.bytesize,
:form_option, :copycontents, :pointer, content,
:form_option, :contentslength, :long, content.bytesize,
:form_option, :end
)
end
end