Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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
5,799 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.