Jump to content

File sharing system PDO help!


R0xxy

Recommended Posts

 during lesson time we're developing php systems and our topic is virtual storage like dropbox, google drive etc. My teacher has now set the task to enable the ability to share files within the server but also restrict access within the server folder. I'm being taught MySQL however I've read a lot about PDO being better and decided to use this method to try and get a higher grade for my project although I'm having difficulty understanding how to go about it what i want to achieve is:

  • creating file sharing capability (i.e. students can share group projects)
  • restricting users (only those working on a particular document can view it)

don't worry this is not for my own benefit I'm just trying to get a grade here, I mainly just want advice on what I need I've read quite a bit but unfortunately I'm more of a visual learner.

Link to comment
Share on other sites

MySQL and "mysql" are two different things. Yes, the capitalization can matter when talking about PHP.

MySQL is the database engine where all your data goes. "mysql" is the name of an old PHP extension that you can use to access MySQL. PDO is also an extension for accessing MySQL (and other database engines) but has many benefits over "mysql".

 

The only difference between mysql and PDO, that matters here, is the code you write to interact with the database. Everything else is the same - the file sharing, the group projects, the user restrictions... So you can go about the project like you were originally going to/intended to and all you need to change is that your code uses PDO instead of mysql.

 

Now, while I commend you on learning about PDO and recognizing you should try to use that instead, don't let it weigh you down. If you've been taught mysql and its mysql_* functions then you may need to go with that. Like if you're pressed for time. It'll take you all of 2 minutes to ask your teacher about using PDO in the project - maybe s/he doesn't want you to because they only have the mysql stuff installed (since extensions require a bit of installation). On the other hand, maybe s/he'll be excited that you went out to learn something else and will give you extra credit for it. Dunno.

Link to comment
Share on other sites

hi sorry i meant the old php syntax i would like to learn pro as it is a project and by extending my knowledge i can get a higher mark which i really want I'm just not sure how to go on about this file sharing system my teacher hadn't covered it in class she just set it as a task. been looking online but I'm sort of dyslexic and reading about code doesn't help me much i need visual guidelines do you know of any good tutorials or videos online i tried look in youtube and didn't find what i need

 

thanks

Link to comment
Share on other sites

I'm really not a tutorial or video kind of learner so I can't help you much there.

 

Try breaking everything down into smaller pieces, one at a time. File sharing means that someone has to be able to upload a file, probably give it a name or description or something helpful like that, and then someone else has to be able to download it. So that's two questions right there: how do you upload files, and how do you make someone download a file?

Then you need to find a way to restrict who can access the files. That means you have to be able to tell who the user is, and that means a sort of register/login system. Look for answers about how to make those. After that comes the problem of knowing whether the user can download a particular file, which means storing something in the database about which users can access which files.

 

Don't forget your greatest resource: your teacher. Believe me when I say that most teachers love it when you come to them for help instead of just guessing your way through and making things up as you go.

Edited by requinix
Link to comment
Share on other sites

I'm really not a tutorial or video kind of learner so I can't help you much there.

 

Try breaking everything down into smaller pieces, one at a time. File sharing means that someone has to be able to upload a file, probably give it a name or description or something helpful like that, and then someone else has to be able to download it. So that's two questions right there: how do you upload files, and how do you make someone download a file?

Then you need to find a way to restrict who can access the files. That means you have to be able to tell who the user is, and that means a sort of register/login system. Look for answers about how to make those. After that comes the problem of knowing whether the user can download a particular file, which means storing something in the database about which users can access which files.

 

Don't forget your greatest resource: your teacher. Believe me when I say that most teachers love it when you come to them for help instead of just guessing your way through and making things up as you go.

 

 

thanks its put it to an easier perspective i already have a register and login process working along with a file upload the next step is to enable a file download feature :)

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.