0

the other day I needed to get a python file, which was hosted on a url (the actual url is not publicly available, so I'm just making a url up as an example)

So the file was available at a url similar to this:

https://platform.MyUni.dk/pluginfile.php/275570/course/section/131710/app.py 

I wanted to try to use wget to get the file, so I just went straight ahead and tried it

wget https://platform.MyUni.dk/pluginfile.php/275570/course/section/131710/app.py 

This did get the file, which correctly is a python file. But if I then look into the file, then it looks like this:

ask@Garsy:~/Notes/AdvancedSec$ cat app.py <!DOCTYPE html> <html dir="ltr" lang="en" xml:lang="en"> <head> <title>learnIT 

Full of HTML. This really is a bit strange to me. If I paste the link into my browser, then I get the option to download the file, and this works as it should.

How does all this html end up inside this file? and what can I do about it?

0

1 Answer 1

-1

The web server put it there so that the file pretty-prints in a web browser.

This is the actual web page. https://platform.MyUni.dk/pluginfile.php

This is the file that is actually presented to you.

75570/course/section/131710/app.py 

Look for the raw version of the file.

Otherwise, use a text editor to modify the file that you have now.

4
  • hmm I'm a little confused, i'm aware that the base url is the webpage. Should the raw file be hosted somewhere on the same system or how? Commented Sep 2, 2021 at 18:57
  • Should the raw file be hosted somewhere ... not necessarily ... it is up to the owner of the website to decide if raw files are available for download ... ask them Commented Sep 2, 2021 at 19:03
  • ah okay, so likely there is no flag that I can put on ẁget in order to get it to work? Commented Sep 2, 2021 at 19:10
  • why would you say that it is likely? ... that is an invalid assumption ... it is unknown ... there is a difference Commented Sep 2, 2021 at 22:07

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.