How do I upload a sketch with easiest way to Arduino Mega 2560 via WiFi?
You can’t. First, it doesn’t have Wifi on board. So what other kind of wifi-shield do you have (in mind) to make that interface. Second, the bootloader does not have the proper code in it to make that happen. An ESP8266 with large enough memory chip does have the ability to be programmed OTA (over the air). But your code needs to be prepared for that. It won’t work by default. And something tells me you want more GPIO pins than it has.
Ok, thanks for your response!