本文整理汇总了C++中FormDataList::appendBlob方法的典型用法代码示例。如果您正苦于以下问题:C++ FormDataList::appendBlob方法的具体用法?C++ FormDataList::appendBlob怎么用?C++ FormDataList::appendBlob使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FormDataList
的用法示例。
在下文中一共展示了FormDataList::appendBlob方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: appendFormData
bool FileInputType::appendFormData(FormDataList& encoding, bool multipart) const
{
FileList* fileList = element()->files();
unsigned numFiles = fileList->length();
if (!multipart) {
// Send only the basenames.
// 4.10.16.4 and 4.10.16.6 sections in HTML5.
// Unlike the multipart case, we have no special handling for the empty
// fileList because Netscape doesn't support for non-multipart
// submission of file inputs, and Firefox doesn't add "name=" query
// parameter.
for (unsigned i = 0; i < numFiles; ++i)
encoding.appendData(element()->name(), fileList->item(i)->fileName());
return true;
}
// If no filename at all is entered, return successful but empty.
// Null would be more logical, but Netscape posts an empty file. Argh.
if (!numFiles) {
encoding.appendBlob(element()->name(), File::create(""));
return true;
}
for (unsigned i = 0; i < numFiles; ++i)
encoding.appendBlob(element()->name(), fileList->item(i));
return true;
}