Share local files over the internet on Linux?

-1

I have 30+GB of video files, which I'd like to share with a friend overseas. I have xampp, installed on Xubuntu 12.10 in /opt/lampp/, and the drive containing the video files is on /mnt/MEDIA/. How to set-up apache or maybe another web-server to provide streaming option for his media player (I dont' want to make him download the files). I'm not sure if he's gonna use VLC or GOM Player, but it doesn't matter, he'll use whatever I tell him :)

Emil Avramov

Posted 2013-09-23T10:16:18.213

Reputation: 183

1A simple webpage with a link to the media file should be enough. – terdon – 2013-09-23T10:37:39.630

You mean file:/// ? If so, it doesn't work in most browsers due to security. – Emil Avramov – 2013-09-23T10:52:23.793

1No, I mean HTML with <a href="/path/to/file/">file</a>" – terdon – 2013-09-23T10:53:07.743

This only works if /path/to/file/ is a subfolder/subfile of /opt/lampp/htdocs – Emil Avramov – 2013-09-23T11:20:57.747

That depends on the way you have set your webserver up, but you should be able to make it work if you make a link (ln -s /path/to/file/foo.avi link_to_foo.avi) to the media file and then point the HTML page to that link: <a href="link_to_foo.avi">file</a>". – terdon – 2013-09-23T11:27:43.933

Can you explain this a bit more detailed, please? And is this gonna mess up my other projects in htdocs? – Emil Avramov – 2013-09-23T11:31:38.450

Answers

1

This is the simplest way, just make links to your media files and make an HTML page that points to them:

  1. Make a link to each of the files you want to share in a directory that is configured to be accessible (htdocs for example)

    find /media/videos -name *avi -o -name *mpg -o -name *mpeg -o -name *mp4  \
      -exec ln -s {} +
    
  2. Make a simple HTML page with hyperlinks to each of these files

    echo "<html><body><ul>" > media.html
    for i in *avi *mpg *mpeg *mp4; do if [ -e "$i" ]; then 
      echo "<li><a href=\"$i\">$i</a>" >> media.html
    fi; done
    echo "</ul></body></html>" >> media.html
    
  3. Point your browser to music.html and click one of the files.

terdon

Posted 2013-09-23T10:16:18.213

Reputation: 45 216

Yep, works like charm :) I even can make my own UI now :) I really appreciate your help! :) – Emil Avramov – 2013-09-23T11:59:28.390