Bug 907428 - Include the file path in the 'filename' field in the MIME headers for files in multipart form submissions. r=sicking

This commit is contained in:
Jonathan Watt 2013-08-23 08:44:11 +01:00
parent 45037ed8c8
commit 97b5d660ad

View File

@ -470,6 +470,13 @@ nsFSMultipartFormData::AddNameFilePair(const nsAString& aName,
if (filename16.IsEmpty()) {
filename16.AssignLiteral("blob");
} else {
nsAutoString filepath16;
rv = file->GetPath(filepath16);
NS_ENSURE_SUCCESS(rv, rv);
if (!filepath16.IsEmpty()) {
filename16 = filepath16 + NS_LITERAL_STRING("/") + filename16;
}
}
rv = EncodeVal(filename16, filename, true);