How to re-upload code in arduino ethernet shield?

First i can use my mobile to connect to arduino but after awhile this message will pop out "unable to get a response with the specified URL"so i need to upload again the webserver code in arduino so that it will work again if someone can help me if i can code and make a button for re upload using MIT inventory app.. it is my code or it is connection problem??

Find the problem with your system instead wasting time on some dumb workaround.

Fully agree with the pert's comment.

Having said that, instead of uploading again, another workaround: have you considered the reset button?