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 can i get the file attachment from database

my form have <input type="file" name="attachment" id="attach" /> after i attach a file i'm using php to save the file to my database. But from my database it just a file name. how can i actually attach my file and i can search it back from my htdocs?

2 Answers

You won't actually be saving files to your database, but actually uploading them to your server. Keeping the file path in the database could be useful for finding files in the future though.

Check this out to learn about basic file uploading with php.

Thanks Erik that was a quick responsed

Np! :D