RAW, no, but a DM might allow it
Rules as Written, the longsword does slashing damage, and there are no rules that suggest otherwise (i.e. no weapon property that allows a different damage type), so it cannot deal bludgeoning damage.
However, if it seems reasonable to your DM, they might allow it. If I were your DM, I might allow it if your character had already seen other party members dealing bludgeoning damage and generally doing better for it, then roleplaying a brief scene where your character's like "Hmm, I can smash bones easier than I can cut them, maybe I should try holding my sword like this?", but ultimately whether this is allowed depends on each individual DM (some may allow it without any roleplay to justify it in-game, some may disallow it regardless because that's not RAW).
That said, if I were to allow it (and therefore if other DMs were to allow it, they may well rule the same), I would do as Erik's answer suggests; since, although one can use a sword in this way, it is not designed to be used in this way, so it should use the improvised weapon rules, which means it would do 1d4 bludgeoning damage instead of 1d8 slashing damage.