1

I'm unable to determine the reason for the problem that I have copying binary files from my Linux VM to my Windows VM.

Steps performed:

On Linux:

  1. Enabled apache2 service on Linux
  2. Copied the exe file to /var/www

On windows:

  1. Opened a PowerShell session
  2. Executed (new-object system.net.webclient).downloadfile("http:// IPadd /file.exe","file.exe")

  3. I receive the following error:

Exception calling "DownloadFile" with "2" argument(s): " The remote server returned an error: (404) Not Found." At line:1 char:47

+ (new-object system.net.webclient).downloadfile <<<<

("http://< IPADD >/file.exe","file.exe")

+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException

+ FullyQualifiedErrorId : DotNetMethodException

The command is very simple and it works fine if the copied file is an ASCII file but it always gives that error for any binary file.

I didn't find any difference copying text or executable files in PowerShell.

Is there a mistake here?

Luca Kiebel
  • 9,790
  • 7
  • 29
  • 44
Akkosh
  • 11
  • 2
  • 1
    I wonder if this is better tagged with apache2? It could be how the file is hosted (i.e. the apache2 service might be trying to execute the binary and serves up the result). Can you download the binary by just navigating there with your browser? – Micah Hunsberger Aug 15 '17 at 03:53
  • 1
    I'll second Micah's comment, the 404 not found error is generated by your apache not dotnet/powershell. Take a look at your apache error log "tail /var/log/apache2/error.log" – Olaf Reitz Aug 15 '17 at 07:37

0 Answers0