Results 1 to 2 of 2

Thread: upload file

  1. #1
    Join Date
    Dec 2004

    upload file

    i am attempting to create a career center section of my website. I want users to be able to submit a cover letter and a resume and it submits to an email address ie, careers@whatever.com. i have created the javascript to upload the file however I need it to be sent to the email address along with contact info. here is the code I have wrote to start:

    <SCRIPT LANGUAGE="JavaScript">

    <!-- Begin
    extArray = new Array( ".pdf", ".doc");
    function LimitAttach(form, file) {
    allowSubmit = false;
    if (!file) return;
    while (file.indexOf("\\") != -1)
    file = file.slice(file.indexOf("\\") + 1);
    ext = file.slice(file.indexOf(".")).toLowerCase();
    for (var i = 0; i < extArray.length; i++) {
    if (extArray[i] == ext) { allowSubmit = true; break; }
    if (allowSubmit) form.submit();
    alert("Please only upload files that end in types: "
    + (extArray.join(" ")) + "\nPlease select a new "
    + "file to upload and submit again.");
    // End -->


    Please upload only files that end in:
    document.write(extArray.join(" "));

    <form method=post name=upform action="some-script.asp" enctype="multipart/form-data">
    <input type=file name=uploadfile>
    <input type=button name="Submit" value="Submit" onclick="LimitAttach(this.form, this.form.uploadfile.value)">

  2. #2
    Join Date
    Dec 2004
    Here's a few prior threads I've participated in on this subject:


    Particularly, this one:


    If the first search link doesn't work automatically, go to the advanced search feature and plug "phpnovice" into the user name field and "file upload" into the search text field.
    Last edited by phpnovice; 05-16-2005 at 09:41 AM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center