Golam, you do understand that all the Arduino IDE does is call another program to do the actual upload? For AVR Arduinos it's AVRDUDE and for the Due it's SAM-BA.
The Due is a little different because it doesn't have a bootloader like the AVR. The code which does that function is in ROM and can never be erased from the Due.