I have a home-made webserver on my Ubuntu box. If I include an executable ("HelloWorld") in the folder with index.html, then use:
Code:
<a href="HelloWorld">Hello World program</a>
to make it a link, then it gets downloaded when someone clicks and saves it.
When you try to run it, it says "Access Denied." I have to
Code:
chmod a+x HelloWorld
just to be able to run it.
Does anyone know why this happens? Is there a way to fix this?
So the HelloWorld has no file extension?
It actually has a ".exe" extension, but it's not necessary in *nix to have one.
What the Hello World script coded in? And why is there a .exe extensions if you're on Nix?
Yes i realise that. Still i cant quite understand the point here? Excuse my ignorance.
You run nix yet you want to run an .exe?
I assume its for infecting someone or something similar.
Why not try linking to the file with the extension added?
<a href="HelloWorld.exe">Hello World program</a>
Did anyone read my post??
@DAMINK: That's exactly the HTML I used.
@trilobyte: It's C++. Compiled, of course.
Back @ DAMINK: Here is the issue:
I can run the executable fine.
I post it on my webserver.
I download it from myself [or onto any other computer, for that matter]
I can no longer run the downloaded file. It lost its "x" attributes.
???
Profit!
[the "???" must mean: Your Solution] ^_^
Gunna test this now on my Home server and see whats the go here. This should not happen.
What do you open .exe files with default? Wine i assume?
I have a seperate issue stopping me from testing this properly on my server.
But here it is if you want to test see if the same problem?
Code:
http://www.damink.com.au
At the bottom of page. Named Hello World Program.
Test that i guess and see if its your system or your server???
I opened it up in Wine OK, I guess . . . well, some "Anry color picker" program came up.
But I was sending a file executable in Linux, and running it in Linux. I set "chmod 777" and/or "chmod a+x" and all that before sending, but [just like when I downloaded your exe] the "x" attributes weren't there.
EDIT: Sorry if I'm confusing; The file was created in Linux and compiled in Linux. It runs fine on a Linux system by running:
or:
depending on how I named it. After the file transfer, though, it is not able to be run like that. I have to
to make it executable again.
I wonder if it has to do with
how I'm sending it over TCP??? I can post my 200 lines of webserver code. It is in C. If you don't know, maybe g4143 would. He seems like he knows his stuff. A regular C-wizard.
EDIT#2: I just realized that you probably don't know who g4143 is. I'm getting my HF and SF mixed up.