URL encoding is necessary for query content but not for file name.
Added some comment information. Corrected some Id, ID_G to have them 
consistent with example link.