Jump to content

Contact form with multiple email attachment


Irresistable

Recommended Posts

I've got a fully working contact form, and I've seen single email attachments which simply an input file.

Although what I'm looking for is something like Hotmail. However the upload field stays there, you click browse find your file and click ok. That then disappears from the textbox, and ends up in a field above or wherever I wanted it to be.

Also with a delete button.

 

I have seen something similar to this but can't find it again.

Does anyone have any tutorials, or a code they can provide for something like this?

Link to comment
Share on other sites

You can do that with jQuery... Correct me if I'm wrong,

you want do display all the files underneath each other?

 

Take a look at:

http://www.fyneworks.com/jquery/multiple-file-upload/

 

When you click the choose file button some text with an "X" next to

it appears...

 

If you don't have jQuery, I highly recommend you to start using it,

it prevents a lot of headaches...

 

You can get a tutorial on it here:

http://www.w3schools.com/jquery/default.asp

 

And here is the official documentation, if you go through it

thoroughly you should be able to know almost everything about it:

http://docs.jquery.com/Tutorials

 

That jQuery Multiple File Upload thing is a great plugin, you can

even write plugins and then share it with the jQuery community..

 

I hope this helps a bit...

Link to comment
Share on other sites

I found a prettier looking multi file upload for you at:

http://www.uploadify.com/ but this uses

a type of flash though, but luckily there is a jQuery

plugin that covers that part:

http://jquery.thewikies.com/swfobject/

 

The SWFObject is an addon for jQuery that offers

unique functionality to embed Flash content using

the internal jQuery API

 

Don't worry, the uploadify download comes with

a flash object to implement in the zip file, after that you

include the jquery-1.3.2.min.js, uploadify.js, uploadify.css

and swfobject.js into your page...

 

You then implement it like so:

<input id="fileInput" name="fileInput" type="file" />
<script type="text/javascript">// <![CDATA[
$(document).ready(function() {
$('#fileInput').uploadify({
'uploader'  : 'uploadify.swf',
'script'    : 'uploadify.php',
'cancelImg' : 'cancel.png',
'auto'      : true,
'folder'    : '/uploads'
});
});
// ]]></script>

 

This should work...

 

To see the original implementation details of this plugin,

go to:

http://www.uploadify.com/implementation/

 

Hope this is what you wanted

Link to comment
Share on other sites

http://www.uploadify.com/demo/

The multiple file upload on there looks good. Although, how would I put it as an email attachment?

The style does look good however with my contact form.. i'd like the files to be automatically uploaded instead of clicking the upload button, and without removing it when the file has uploaded.

 

Then when a user clicks submit, to send the form- the files get sent with it.

I'm not if uploading the images to the directory "uploads" would be used, because it might get mixed up. Unless when the file gets uploaded, the file name gets an id, and a session id gets created or what?

 

I'm having a look at it now, but can you help me with that?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.