Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

PHP

How do I create an Upload and Download PHP System?

How do I create an upload and download system with MySQL and PHP. I am trying to add it on to my Log in System.

1 Answer

hm.. so you want your users to allow them to upload files? & then download them later on?

well you need a database where files are tied down to a user, create a form upload to allow users to upload files, store them on your server and store the link in the database.

One thing to be aware of it is the file size, if it is too large then the file upload will fail as script excution time will be exceeded.. also try to make sure that you store the files outside your public folder so that users cannot navigate to them i.e. site.com/members/files/dd.pdf because they could then upload something malicious and navigate to that url and "run" it on your site.

I would like to be the only one to use it. How would i go about doing that? I have already created a login system. How could i tie it with that?