Page 1 of 1

Using PHP with a file transfer

Posted: Mon Oct 19, 2009 9:17 am
by target2021
Thank you for taking the time to read my post. Let me begin by saying that I am a novice so please take that into consideration when responding. I have a website that has been worked on by a professional developer and myself.

I presently have a form where my customers can submit contact information, Name, Address, etc. I would like to add the ability for these people to attach a file, EPS, PDF, JPEG, etc. with their submission.

The form presently uses PHP as the method of transferring the information. Can anyone help me with the code for adding a field using PHP that would allow my customers to submit a file with their information?

I don't use a database of any sort for these submissions, the information is sent to an email address.

Any help would be greatly appreciated.

Thank you,

Mike

Re: Using PHP with a file transfer

Posted: Mon Oct 19, 2009 10:09 am
by pickle
Do a Google search for "PHP HTTP File Uploads". There's a really helpful tutorial on the PHP documentation website that should pop up. That'll show you how to transfer the file from the client to your server.

I'd recommend using SwiftMailer for sending your email. It will drastically simplify the work of attaching a file to an email.

Re: Using PHP with a file transfer

Posted: Mon Oct 19, 2009 10:11 am
by N1gel
You will want to upload the file using a html file input.

Here is a helpful tutorial on how to do this with PHP

http://www.w3schools.com/PHP/php_file_upload.asp

It Might also be helpful to read the manual about uploading a file here $_FILES