Go Back   Cyber Tech Help Support Forums > Software > Web Development & Graphic Design


Topic Tools
Old May 25th, 2009, 05:54 AM
Bradley7 Bradley7 is offline
Join Date: Feb 2007
O/S: MacOS
Location: Addelaide Australia
Posts: 50
Uploading a file using a form


I know you have covered this 2 million times but I can't understand.

I have successful uploaded individual fields (text fields) to email using Formmail but I can't upload a file. Been working on this for weeks.

Can someone help. Using formMail scrip

Reply With Quote

Old June 14th, 2009, 01:46 PM
Symbyo RD Symbyo RD is offline
New Member
Join Date: Oct 2008
Posts: 1
You need set the <form> method="post" in order to send the user's file to your PHP script, and then have your JavaScript do form.submit() if the user's input validates. You can't do it with window.location pointing to the script's URL with a query string. The script will then need to receive the information in the $_POST vars and use the PHP function move_uploaded_file() to retrieve the file.

and set enctype="multipart/form-data" in your form element. And use $_fileS as you have done previously. It does not matter if you are submitting the form (or creating the div/form) using JavaScript or not. But... when you are setting window.location.href="..." you are NOT actually submitting the form.
Reply With Quote
Old July 22nd, 2009, 10:00 AM
WayneWhitty's Avatar
WayneWhitty WayneWhitty is offline
Join Date: Dec 2006
Posts: 58
Your form tag should look something like this: notice the enctype.

<form action="" method="post" enctype="multipart/form-data" >
Reply With Quote


Topic Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT +1. The time now is 03:11 PM.