0

Can someone explain how users accounts works on webpage?

www.website.com/profile?uid=15636373282
or
www.website.com/profile/15636373282

As I know each user gets unique uid.

Does website creates for each user profile folder on server to store user profile webpage and pictures, videos?

I know users name and password are stored in database, but I think that store user profile page ,pictures, videos in database, its insaine.

Can someone help me to understand? thank you

Kara
  • 6,115
  • 16
  • 50
  • 57
Eveler
  • 177
  • 2
  • 9
  • Well, if `data` are stored in a `folder` in the webserver, then anyone can download or view it without even having to log in to the site as long as they have the right `url`. – MegaNairda May 26 '12 at 18:10
  • They can't bcoz of rewrite_mod ie orginal url www.website.com/server5/sid23456781/word/word/word/word/profile/folderid rewrite_mod www.website.com/profile/folderid and if you'll write orginal url in your browser you'll get error file not found. – Eveler May 27 '12 at 08:00

2 Answers2

1

Any user profile has 2 parts: the profile text-fields and media data.

Text fields (id, name, desctption, date of birth, etc) are being stored in database;

Basically media data (avatar image, another files) are being stored on disk in some folder and user id references to this folder.

Yes, the site creates this folder. Media files should not be stored in a database!

The "profile webpage" is absctract concept. Site usually generates this page at runtime using the above parameters from database, and media-data(insert images links to page html for example)

odiszapc
  • 4,089
  • 2
  • 27
  • 42
  • So www.website.com/profile/`12345678` as I understand user id is 12345678 and in server exist folder called 12345678 to store pictures and videos? – Eveler May 26 '12 at 15:19
  • Okay. The site is dynamic program. When user has been created the profile folder should be created too by site. The folder may be anywere the site author wants. Yes, the easiest way is to name the folder according to user ID. But it's not important that this folder be in site root directory, it may be exists anywhere – odiszapc May 26 '12 at 15:25
  • So if user logins into his account website connect database to match his login user name and password if matched when database get command to get user id ,by users id website script search for folder named with user id and takes out data from this user folder and creates user profile webpage with pictures and videos.I'm right? – Eveler May 26 '12 at 15:48
  • Nope. The webserver create the page obn the fly. Thats how dynamic web pages work. Try learning php, asp or any other web language you might prefer. – MegaNairda May 26 '12 at 15:56
1

No. The website does not create folders for each users. The ?uid=15636373282 is just a parameter that the web server fetch and retrieve that from the database.

And yes, profile page, pictures and videos are all mostly stored in databases. Though they maybe stored in a different server. Some sites store huge data on a lease or rented servers or some companies that offer cloud storage like Amazon EC2

MegaNairda
  • 829
  • 2
  • 14
  • 24
  • but its insaine to store users video in database if one video is 500MB how database can store sucha large data inside database as MySQL? – Eveler May 26 '12 at 15:24
  • I also find http://www.dropbox.com to be insane. Being able to store all my 8GB of data. – MegaNairda May 26 '12 at 15:27
  • its not insaine if dropbox stored your 8GB data into your account folder,not in SQL database. – Eveler May 26 '12 at 15:41
  • Well I really have no idea how they store things but Dropbox got version control. If I deleted a file or make changes into one, they can track whatever changes I made. I can restore deleted files, or restore previous document prior to the changes I made. Now that's INSANE. – MegaNairda May 26 '12 at 15:58
  • this not insaine if you delete file they store these files in temp folder. similiar to windows recycle bin you can delete and restore it. – Eveler May 26 '12 at 16:27
  • How about the revisions? They also store all of them, I use dropbox as my source revisioning instead of github :) – MegaNairda May 26 '12 at 17:03
  • History, any changes you made they store to server as everybody does.Instead dropbox I use my own server;) – Eveler May 26 '12 at 17:15