Bug 736324 - Give blob urls content-disposition filename based on the file. r=sicking

This commit is contained in:
Tom Schuster 2013-03-21 23:23:48 +01:00
parent 045cb0fba7
commit c7dee7583c

View File

@ -190,10 +190,18 @@ nsHostObjectProtocolHandler::NewChannel(nsIURI* uri, nsIChannel* *result)
nsCOMPtr<nsISupports> owner = do_QueryInterface(info->mPrincipal);
nsAutoString type;
nsString type;
rv = blob->GetType(type);
NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr<nsIDOMFile> file = do_QueryInterface(info->mObject);
if (file) {
nsString filename;
rv = file->GetName(filename);
NS_ENSURE_SUCCESS(rv, rv);
channel->SetContentDispositionFilename(filename);
}
uint64_t size;
rv = blob->GetSize(&size);
NS_ENSURE_SUCCESS(rv, rv);