Added path substitution handing to the submit_file method