Welcome Guest, Not a member yet? Register   Sign In
File Upload Service ideas?
#1

[eluser]Dregond Rahl[/eluser]
So i'm making a file uploader service for a friend and I just want to run some questions with you guys.

User urls. I want them to work like once a user registers their username becomes like a sub domain and anything they do gets connected to that

Code:
dregond.domain.com/My5bF.png

could be processed as

Code:
domain.com/dregond/My5bF.png

I'm not sure if and how that will work tho.


Also, i know there are several ways of handling files. Would it be better for members and guests to upload files and save them with their original file name, or rename it to a random string ?


Premium members who pay a monthly fee and such gets added features like

- Sub-Folders
- Increased upload file size
- Zip downloads of all their files as backup

So obviously ill need an ACL system, but how would I handle sub-folders?

Two ideas are there, one is that everyone's files are stored in one folder and the DB display as needed, and another is to actually make folder but still have a DB to monitor them.

I'm starting coding the system now. So just going thru some ideas before i begin work. =]
Any added features you would like to see is appreciated =]
#2

[eluser]Jondolar[/eluser]
I recommend you store the files with a random name and if you need to refer to the orginal name, store it in the database. You don't necessarily need to store the files separated by user. They can all mingle and then use the database to refer to each one specific to a user. However, if you have a large number of files, you may want to use subdirectories and sub/subdirectories to spread your files out so you don't have a million files in one directory. If you come up with a random name for the filename, you can use the first 4 characters to point to the sub/subdirectory (using 2 chars for sub and 2 chars for sub/sub). This will spread your files out and make access easier (as well as any file maintenance you may need to do). So you don't need to worry about using an ACL system on sub-folders, just on the functions that access them. Also, you probably don't want to give direct access to the files but instead use a php file that creates the proper header and passes the file to the browser.

I've seen posts on how to set up CI so the subdomain is routed to a controller/function/subdomain and then you can use the subdomain as a parameter to your function.

Good luck with your project.
#3

[eluser]Dregond Rahl[/eluser]
Maybe i can use Routing to redirect from

Code:
domain.com/WxhY5b.png

to

domain.com/hosted/files/WxhY5b.png


Or is outputing it thru PHP the better method ?
#4

[eluser]jedd[/eluser]
I have never done anything like this (that's the ObDisclaimer out of the way)

Rename the files - something like username + "-" + 8601 datestamp (down to seconds) would work quite well. Your db still manages the mapping to original filenames, but your debugging just got a lot easier. Random's good if you want to hide something, but you don't want to hide anything here do you?

You didn't mention how many files you'll have - nor what file system you'll be using. Some file systems are optimised, or at the very least not afraid of, very many files in a single directory. ReiserFS is an obvious example if you're hosting on GNU/Linux. Separating into sub-directories may make some things much harder, but may offer you some performance benefits. You know the best way to identify the pros and cons of this tradeoff?

For accessing the files (via PHP of course) I'd offer a URL that pointed at the download controller, so something like
http://site.com/dl/filename.ext

Your call on the latter - you could pipe that through a dl/username/filename.ext instead, and you might want to zip (with zero compression) every file before you send it so that your URL doesn't break on dodgy filenames (where dodgy means something that one file system can cope with, but a URL can not). For zip I mean zip or tar or rar or 7z or whatever container you find easiest to deal with on the fly.

If your friend says they don't want the extra three characters (dl/) in the URL, tell them firstly to lower their expectations and get over themselves, and secondly you might be able to route based on the presence of a key character - eg an underscore - and your URLs would become site.com/username_8601datestamp - where you pick up your storage filename. If you were to store each file in a pre-containered format (again, you don't have to actually compress things - not many files that people share compress very well anyway) then you could just offer it up directly from your storage area as a .zip, say, and the user's OS would typically be smart enough to automatically open it with their archiver of choice. Again, this is all to save any problems with filenames that aren't sociable across all OS's and URL's.
#5

[eluser]n0xie[/eluser]
Quote:Premium members who pay a monthly fee and such gets added features like

- Sub-Folders
- Increased upload file size
- Zip downloads of all their files as backup
Not to rain down on your parade but there a LOT of companies already offering this, and they have the money, size and infrastructure to back this up. Is your friend REALLY sure he wants to pursue a business in a rather saturated market? If he believes this is a viable business model he might want to take a good look at the competition: services like Rapidshare, Yousendit, Sendspace, Mediafire and Megaupload (off the top of my head).

Also there are a lot of companies offering complete online backups of your files against reasonable rates.
#6

[eluser]Jondolar[/eluser]
[quote author="n0xie" date="1242829136"]
Not to rain down on your parade but there a LOT of companies already offering this, and they have the money, size and infrastructure to back this up. Is your friend REALLY sure he wants to pursue a business in a rather saturated market? If he believes this is a viable business model he might want to take a good look at the competition: services like Rapidshare, Yousendit, Sendspace, Mediafire and Megaupload (off the top of my head).

Also there are a lot of companies offering complete online backups of your files against reasonable rates.[/quote]

There are a lot of companies offering everything. Should that stop everyone else from doing anything?

I entered the shopping cart market and charge a fee even though there are tons of free shopping carts in a "saturated" market. I disagree with n0xie. Go for it. Make your product better, faster, cheaper, unique, fun, whatever.
#7

[eluser]Dregond Rahl[/eluser]
Unlike other uploaders, we have a core market, mostly forums and such, for them its not about being flooded by adverts or having download delays. Our system will be similar to MediaFire and be based on word-of-mouth to get things out. Also direct linking and integration with other forums systems will be there too. Its not about the features, people mostly couldn't careless if they can make files fly in the air, they just want a good way to upload files and get links and leave, that's where I will be focusing on.

From what I know mostly will be Images and PSD's and such. =]




Theme © iAndrew 2016 - Forum software by © MyBB