jck
jck

Reputation: 2058

How can I download a perl script from a CGI server instead of running it?

I am trying to download the perl scripts from this site: http://pages.cs.wisc.edu/~david/courses/cs552/S12/handouts/bins/

When I open or download any of them, the scripts execute. However, I want the text in the scripts. Is there any way I can do this?

Upvotes: 1

Views: 3772

Answers (3)

dannix
dannix

Reputation: 235

If the scripts are executing then the webserver is configured to execute scripts in that directory or it is configured to execute all .pl or .cgi files where ever they reside. That is normal for a webserver to execute a script. If you want the script source then the webserver must be configured to not execute the scripts, in which case it would deliver the source you are after. Contact the administrator to configure correctly, assuming they shouldn't be executing.

Otherwise you would need filesystem access to ~david/courses/cs552/S12/handouts/bins/, be it via FTP or whatever to download them. Basically access however you can without it being over HTTP.

Upvotes: 2

servn
servn

Reputation: 36

Just right-click it and choose "Save link As..." (works only if no script processing enabled on server side)

Normaly you can't do this, because when you request any script it beiing processed server-side and only result shown at browser. If you try to configure you httpd to let users download scripts you should disable script handling by extension, or just change the extension to txt for example.

Upvotes: -1

ikegami
ikegami

Reputation: 385897

For the non .pl files,

The server is actually retuning the script (not its output), so you must be executing it on your end. Right-click on the link and choose Save Link As.

For the .pl files,

The server is actually executing these scripts and returning the output. You would need to use a different URL to get the script itself. No such URL is likely to exist.

Contact your prof and advise him of the issue.

Upvotes: 5

Related Questions