Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
10-22-2013, 03:37 PM #1
- Join Date
- Oct 2013
- Thanked 0 Times in 0 Posts
Form data with Multiple File Upload
I need help on saving form data to server sql database with multiple file attachments with some basic form validation.
File attachments should be saved in the server in a specific folder, and the attachements name and the other form data should be stored in the sql data base. I am not sure where to start on this . your help is greatly appreciated...
10-22-2013, 04:27 PM #2
- Join Date
- Sep 2002
- Saskatoon, Saskatchewan
- Thanked 2,662 Times in 2,631 Posts
You can use an HTML file input with a name ending in  and it'll create an array of $_FILES for you to work with. Iterate that array, check and validate the uploaded files as necessary, and generate a random name for them. Verify that the random name is not yet in use, and use that name as a part of the filepath in the dbms to store with the other data input in the form.
See here for more information on uploads: http://www.php.net/manual/en/feature...ost-method.phpPHP Code:
header('HTTP/1.1 420 Enhance Your Calm');