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

Databases

I need code help on one of my project

I am building a website, in which i want to have a button that says download and when user clicks on that button the files from my server gets copied to their computer. and as soon as they click the button they get to choose where they want to save it.

UPDATE:

when its time to update content i will make an update button on the same page, when they click the update button the new files on my server gets copied to the destination they select and override the old (previously copied files) files.

1 Answer

Chris Predkiewicz
Chris Predkiewicz
6,457 Points

Hello, If the file to be downloaded already exists on your server, then you must provide the link to the download file when the user clicks the button <a href="download file.zip">Click here to Download</a> If you want the users to update the file on your server, that needs to be a file upload feature within a form element. You need to use some server-side language to perform the function like PHP to handle the file uploads.

I understand what u r saying. First of all thank u for responding. And my first question about the project that I'd I want to setup a database can I add PDF and mp4 and mp3 files, and want to retrieve the data by just one clock of a download or upload button and push it to the user's computer. And the second thing is that I know that we can use PHP to do all that but don't know what code to use. And I want the user to select destination.