|
Web Development & Graphic Design Problem Solving for Graphic Design, PHP, ASP, Perl, MySQL, SQL, XML, HTML issues |
|
Topic Tools |
#1
|
|||
|
|||
Uploading a file using a form
Hi
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 Brad |
#2
|
|||
|
|||
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. |
#3
|
||||
|
||||
Your form tag should look something like this: notice the enctype.
Quote:
|
Bookmarks |
«
Previous Topic
|
Next Topic
»
Topic Tools | |
|
|
Similar Topics | ||||
Topic | Topic Starter | Forum | Replies | Last Post |
Uploading a whole file with photos | perplexed | Applications | 4 | November 27th, 2008 02:54 AM |
Outlook - Form cache file not valid. Outlook cannot start. | catbiz | Applications | 1 | March 29th, 2006 10:00 PM |
Personal Web site uploading song file | saskatoon | The Anything Else Board | 1 | June 17th, 2003 02:03 AM |
All times are GMT +1. The time now is 12:52 AM.