我正在尝试在 Delphi 7 Webbroker CGI 中接受文件上传。
我正在使用 Shiv Kumar 的 TMsMultipartParser,但 Chrome 有问题。我无法访问解析的数据(令人惊讶的是,Explorer 工作正常)。
这是我的代码:
with TMsMultipartFormParser.Create do
begin
Parse(Request);
lsExternalID:=ContentFields.Values['external_id'];
if (lsExternalID='') then
raise Exception.Create('No external ID');
for i := 0 to Files.Count -1 do
begin
lsFileName:=files[i].FileName;
//Rename file using external ID (not included for simplicity)
Files[i].SaveToFile(lsFilename);
end;
Response.Content := 'OK';
free;
end;
正如这里所建议的,我尝试使用http://www.mrsoft.org/Delphi/MultipartParser.pas但我无法编译它。它使用了一个我在任何地方都找不到的名为 UniversalUtils 的单元。
我知道这是一项非常过时的技术。几乎所有对它的引用都已经从网络上消失了(相信我,我已经搜索过了)。购买任何帮助将不胜感激。
谢谢。