Solved

Online Form - Ataching Images

Posted on 2001-08-19
9
188 Views
Last Modified: 2013-12-25
Hi,

I have a standard contact form on my webpage which allows input such as name, address, email. When the user presses SUBMIT these details are sent to my email address.

However I would like to add in functionality which allows the users to browse to image files on their Hard Disk and send them to my email address along with the other information. This would work much like the "attatchment" feature in hotmail which lets you browse to a file and attach it to the email.

How would I do this?

Thanks,

Neil

0
Comment
Question by:homersim
  • 3
  • 2
  • 2
  • +2
9 Comments
 
LVL 8

Expert Comment

by:bebonham
ID: 6404311
can you post the script you are currently using now, so we can get an idea of what you are after?


however, to get optimal results without a lot of code, you will need to be sure and have the module MIME::Lite installed on your server

if you have that module installed, I have a simple solution.
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 6404477
<FORM METHOD="POST"  ENCTYPE="multipart/form-data">
  <INPUT NAME="uploadfile"  TYPE="file"  VALUE="">
</FORM>
0
 
LVL 8

Accepted Solution

by:
jhurst earned 150 total points
ID: 6420591
ahoffman is on the right track.  You need the TYPE="file" and the ENCTYPE, problem is that this will not work with a direct send to mail.

Hotmail, which you want to emulate actually receives this form with a cgi and then converts this to the required data.  You will need to do the same.  It is not hard.

I could attempt to explain the format of the file that you will receive but realistically you would be much better to just write a simple script that accepts the data and dumps it to file first.  Then look at the file.  When you look at this file the way in which the TYPE="FILE" data is stored will be obvious.

0
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 
LVL 51

Expert Comment

by:ahoffmann
ID: 6420795
> ..user presses SUBMIT these details are sent to my email address.

oops, missed that.
Therfore <a href=mailto: ...> is used, it spawns a application specified by the user (respectively his browser and/or OS) which is responsible for browsing the local filesystem.
Probably a Java-applet can do what you want
0
 
LVL 8

Expert Comment

by:jhurst
ID: 6422681
Problem with <a href=mailto... is that it just does invokes the mailer and does not interact with the form, sadly.

I do agree that a Java Applet can do it but it would be easier and more general since at this point we are writing code, to do it server side.  Remember that a lot of people disable Java and worse, windows XP comes without Java support at all.

0
 
LVL 16

Expert Comment

by:maneshr
ID: 6628114
homersim,

Did you get the solution you were looking for?

What solution, if any, did you use?

Please let us know.

Thanks,
0
 
LVL 16

Expert Comment

by:maneshr
ID: 6654401
homersim,

Did you get the solution you were looking for??

What solution, if any, did you use??

Pl. let us know.

NOTE: if you have found a solution on your own or if this question has become obsolete, please delete  it and free up your points.

Thanks,
0
 
LVL 16

Expert Comment

by:maneshr
ID: 6675226
homersim,

                     Did you get the solution you were looking for??

                     What solution, if any, did you use??

                     Pl. let us know.

                     NOTE: if you have found a solution on your own or if this question has become obsolete, please delete
                      it and free up your points.

                     Thanks,
0
 
LVL 1

Expert Comment

by:Moondancer
ID: 6699244
Last login was August; apparently abandoned.  Proposed answer was not rejected, assume it served and closing.
Moondancer
Community Support Moderator @ Experts Exchange
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction This tutorial will give you a fast look what you can do with WhizBase. I expect you already know how to work with HTML at least, and that you understand the basics of the internet and how the internet works. WhizBase is a server-s…
This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
Learn the basics of while and for loops in Python.  while loops are used for testing while, or until, a condition is met: The structure of a while loop is as follows:     while <condition>:         do something         repeate: The break statement m…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question