tags:

views:

359

answers:

2

Hello sir/madam, Sir I'm new for php, Sir now I'm working on website ,In which there is one problem is occure in email form, sir i want to attach more than one file as attachments(for this task i got required code ),I have one browse button,but i'm not getting what code i have to write there for invoking required file/directory/folder,(when i click on browse button one window is open from which i take single file at a time ,as like gmail compose email form), i think u understand what i want to tell u,(i'm not having well communication) Plz help me, I'm waiting for your response, Thanking You in Advance

A: 

Amol, simple procedure to accomplish this is to provide multiple file upload controls on your form like:

<input type="file" name="file1">
<input type="file" name="file2">
<input type="file" name="file3">
.
.
.
<input type="file" name="file10">

On server side you can iterate over all $_FILES to see how many files were actually uploaded and process them accordingly.

Advanced methods include using an ajax or flash uploader to upload multiple files asynchronously; storing them in a temporary folder and storing list of uploaded files in SESSION. When the send button is clicked, you can process that SESSION variable to determine how many files were attached to the email being composed and process accordingly.

I am sure whatever file attachment script you're using supports attaching more than one file.

Salman A
Thanks Sir,U r right, U understand what i want exactly.Thank u
amol
Thank u sir,amazing its working, So simple it is!!!
amol