Hi chaps, I'm not terribly sure how to go about this. I've got a small site where I want to add some files for people - well me since nobody will ever use that website - to download, a sort of repository if you like a bit like github maybe, but i'm not entirely sure how. Can I use github only for a few files (in other words, is github free considering I don't have an awful lot of files) or does anybody have another suggestion? The way I picture the whole thing in my head is to have the files directly downloadable from my site rather than going somewhere else. How feasible is that? A very quick look on google brought back only github related results...

Recommended Answers

All 15 Replies

GitHub is free, but the free accounts do not have private repos. So anybody could access your files. If you want private, BitBucket provides that.

Uploading files to your website would be an easier solution. Do you just want it as a dropbox, or do you need file versioning?

OK cool, well I don't mind if they are public actually. If uploading to website is easier, I suppose I can go with that, and no, I don't need file versioning, so if I need to change anything on the files, I'll upload them again. So how would I go about that?

Member Avatar

What's wrong with Dropbox? If it's only you that uses it, then Dropbox (or similar) seems a reasonable choice. Difficult to know what to suggest as we don't know what type of filing system you have in mind. Dropbox does have limitations with regard to not syncing symlinked folders (folders that are physically outside the dropbox folder on the device but linked to the dropbox folder via symbolic link - like a glorified shortcut). I got so frustrated with this I signed up with sugarsync. It's not free, but they have very good deals at the moment.

Remember that most of these remote storage sites offer direct links to files, so you could list links on your webpage that point to files on Dropbox (or Google Drive or any other similar site).

Git is usually used for versioning or for forking your project into branches - is this what you're looking for? - but no reason why you can't use it as a general file repository? Github is free for public repos but if you want to keep your repos private, then I think its currently $7/mo. There are alternatives to github though like BitBucket - which I think has free unlimited private repos.

Well, it's not going to be a filesystem as such: basically, the files are just code samples. On my site I talk about an application I developed and then I provide the code for it (I'm specifically talking about .net application so the files will be .aspx .aspx.cs etc). As said, I don't need to keep them private, and I don't need any versioning because those files are just for me to remember what I did

Here is an example.

Ah, hang on, maybe I got things completely wrong. To store documents on an HTML site I have to use .net or any other server side language? This is the site (sorry for posting the link but I think it will help me to understand better http://antonioborrillo.co.uk/web-development/home.html)? The thing is the webhost doesn't support .net...

this is a php script I use for my notes, it just dumps everything in alpha order, including folders, so every application is sorted

<meta http-equiv='Content-Type' content='text/html;charset=utf-8'>
<title>Note Books</title>
@media print {body {font-size:10pt;}}
@media screen {body { background:url(funny_cat_pictures_76.jpg) no-repeat center right fixed;background-color:#f6f6f6;color:#000000;font-family:verdana, arial;margin:4%;}}
body {background-color:#f6f6f6;color:#000000;font-family:verdana, arial;margin:4%;}
ul.dirlist {list-style-type:none;padding-left:0.5em;margin-bottom:0.2em;text-transform:capitalize;font-weight:normal;} 
ul.dirlist li {list-style-type:none;padding-left:0.5em;margin-bottom:0.1em;text-transform:capitalize;font-weight:normal;}
ul.dirlist li:first-letter  {text-transform:capitalize;font-weight:bold;}
ul.dirlist li a {text-transform:capitalize;font-weight:normal;margin-bottom:0;}
ul.dirlist li a:first-letter {text-transform:capitalize;font-weight:bold;margin-bottom:0.1em;}
.logo {background:transparent;color:#000000;text-align:right;font-size:85%;top:auto;left:auto;bottom:1px;right:1px;position:fixed;}
.logotop {color:#000000; background:transparent;text-align:right;font-size:85%;top:10px;left:auto;bottom:auto;right:1px;position:fixed;}
.smalltext {background-color:#f6f6f6;font-size:85%;} 
.tinytext {background-color:#f6f6f6;font-size:70%;}
<h3>Note books</h3>
<ul class='dirlist'>
<?php $it=new RecursiveIteratorIterator(new RecursiveDirectoryIterator('.'));
echo '<li>'.str_replace("\\","::",$it->getSubPath())." \n<a href='".$it->key()."'>\n".str_replace("_","&nbsp;",str_replace("\\","",substr(trim($it->key(),"\ ."),strlen($it->getSubPath()))))."</a><span class='tinytext'> ".number_format((filesize($it->key())/1024),0)."<span class='tinytext'>KB</span></span>\n";
echo "</li>\n";}} $it->next();} ?>

OK I see, thanks for the code almostbob, so one way or another I will have to have a server side language script to do the job for me, sorry I didn't know, I would have thought that HTML5 had some way to host documents. I may have a look at github as well then

You can always upload files with an FTP client.

that's it, I think that's the solution. I can upload the files to my host server, but then how do I link to them from the site?

Run the php on localhost with the same file structure
view page source
copy and paste the generated html as index.html
ftp to your free host
=php effecct on free host
dont need a whole wamp stack, just a mini environment like quickphp

I was hoping to try without script first, almostbob. If I create a folder in the files system on the host server, how do I link to the file so to download them? Meaning, say the files sit in a folder called files and I want to link to them from my site how do I download them rather than just view them?

depending on the browser what the exact context menu item is called
when you right click the link something like one of

save link as
save target as
save link target as

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.