Careful : This question and the possible answers contain spoilers about the all the endings of Undertale. Don't go further if you do not want to be spoiled.
After you have completed the neutral ending one time, you can reload the game at the barrier and start another fight with Asgore. After defeating him, you can have some additional dialogs with Flowey.
During one of those, Flowey says the following sentence, referring to Papyrus's brother :
You know. Smiley Trashbag.
...
Say. If I have ONE piece of advice for you... DON'T. Let his brother. Find out ANYTHING about you. He'll... well... Let's just say. He's caused me more than my fair share of resets. Stay away from that guy.
It seems like, reading this sentence, that Sans already fought and beat Flowey many times in the past. But, during the whole game, it doesn't seems like Sans has ever met Flowey at all. Is there any evidence in the game other than this dialogue which would confirm a fight between the two characters, like a book, a dialogue, or anything ?