I have written a script which downloads file from web server created by python simple http server. When I wget file at client machine, filename appends with ?. e.g. xyz.ipk downloaded as xyz.ipk? I have checked the script on my test environment everything is working fine. My client is Openwrt os and server is Ubuntu.

  • 3
    What is the exact wgetsyntax you are using? Have you tried with -O file parameter? (check wget man) – Zumo de Vidrio Apr 24 '17 at 12:55
  • Its in while loop, wget"$line" – Sagar Shinde Apr 24 '17 at 12:58
  • 5
    My crystal ball says: your input file has DOS line endings cr/lf, leading to a spurious cr at the end of your filenames. – Ulrich Schwarz Apr 24 '17 at 13:01

By default, wget bases the file name on the URL, not on what the server says the file name should be. To allow the server to choose the file name, use the option --content-disposition.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.