download a file from a form button

Ask a Question related to PHP Development, Design and Development.

  1. #1

    Default download a file from a form button

    I can't get a form coding to recognize a download.php to download a file to
    the client. I need the edits of the form for a MySQL table, but the
    following form code only wants to download 'download.php' and won't access
    download.php so the code can take affect. How can the action item call
    download.php?

    <form name="form1" method="post" action="download.php"
    onSubmit="
    MM_validateForm('LastName','','R');MM_validateForm ('email','','NisEmail');
    MM_validateForm('email','','R');
    MM_validateForm('FirstName','','R');
    return document.MM_returnValue">
    <p><b><font size="3">First Name:</font></b>
    <input type="text" name="FirstName" maxlength="50" size="30">
    <font size="3"><b> Last Name:</b></font>
    <input type="text" name="LastName" maxlength="50" size="30">
    </p>
    eMail:
    <input type="text" name="email" size="40" maxlength="50">
    </b></p>
    <input type="submit" value="Download" />
    </form>



    Doug Guest

  2. Similar Questions and Discussions

    1. Not able to view download button
      When I am on the download page I can not see the download button or any of the other pictures on the download page. I have uninstalled all sweeper...
    2. How do I add download behavior to a button?
      I apologize for my lack of expertise. I don' t even know if I'm posting in the right area. I want to create a button or hot spot that causes a...
    3. Download file from movie button
      I need to be able to create a button that allows the user to download a file directly from the flash movie. File types would include mp3, jpg and...
    4. Creating a Download button in Flash?
      OK, I do not remember how to get a flash button to download a PDF onrelease. I've looked and tried many things but no success. I would really...
    5. JavaScript Access to Button in form tags (webcontrol or html button)
      Hello, I have a button called LoadBtn, which exists in <form name="Form1" runat=server></form> tags. I then have javascript loaded outside of...
  3. #2

    Default Re: download a file from a form button

    *** Doug wrote/escribió (Tue, 7 Sep 2004 16:38:04 -0400):
    > the following form code only wants to download 'download.php' and won't access
    > download.php so the code can take affect. How can the action item call
    > download.php?
    >
    > <form name="form1" method="post" action="download.php"
    Does your server support PHP?


    --
    -- Álvaro G. Vicario - Burgos, Spain
    -- Thank you for not e-mailing me your questions
    --
    Alvaro G Vicario Guest

  4. #3

    Default Re: download a file from a form button

    The files are loaded in a temp directory:

    This is a form to upload files:

    <html>
    <body>
    <H1 ALIGN=CENTER>Upload Web Files</H1><br>
    <form action="ftpput.php" method="POST" enctype="multipart/form-data">
    <input name="userfile[]" type="file"><br>
    <input name="userfile[]" type="file"><br>
    <input type="submit" value="Upload">
    </form>
    </body>
    </html>

    This is ftpput.php:

    <html>
    <body>
    <H1 ALIGN=CENTER>Upload resultaat</H1><br>
    <TABLE>
    <TR>
    <TD><?php print $_FILES['userfile']['tmp_name'][00]; ?></TD>
    <TD><?php print $_FILES['userfile']['name'][00]; ?></TD>
    <TD><?php print $_FILES['userfile']['size'][00]; ?></TD>
    <TD><?php print $_FILES['userfile']['type'][00]; ?></TD>
    <?php copy($_FILES['userfile']['tmp_name'][00],
    '...........properties/residential/' . $_FILES['userfile']['name'][00]); ?>
    </TR>
    <TR>
    <TD><?php print $_FILES['userfile']['tmp_name'][01]; ?></TD>
    <TD><?php print $_FILES['userfile']['name'][01]; ?></TD>
    <TD><?php print $_FILES['userfile']['size'][01]; ?></TD>
    <TD><?php print $_FILES['userfile']['type'][01]; ?></TD>
    </TR>
    <?php copy($_FILES['userfile']['tmp_name'][01],
    '...........properties/residential/' . $_FILES['userfile']['name'][01]); ?>
    </TABLE>
    </body>
    </html>

    If your webserver has sufficient rights on the directory the copy should
    work.

    Success.......


    "Doug" <fabien@ixpres.com> schreef in bericht
    news:413e2730_1@news.vic.com...
    > I can't get a form coding to recognize a download.php to download a file
    to
    > the client. I need the edits of the form for a MySQL table, but the
    > following form code only wants to download 'download.php' and won't access
    > download.php so the code can take affect. How can the action item call
    > download.php?
    >
    > <form name="form1" method="post" action="download.php"
    > onSubmit="
    > MM_validateForm('LastName','','R');MM_validateForm ('email','','NisEmail');
    > MM_validateForm('email','','R');
    > MM_validateForm('FirstName','','R');
    > return document.MM_returnValue">
    > <p><b><font size="3">First Name:</font></b>
    > <input type="text" name="FirstName" maxlength="50" size="30">
    > <font size="3"><b> Last Name:</b></font>
    > <input type="text" name="LastName" maxlength="50" size="30">
    > </p>
    > eMail:
    > <input type="text" name="email" size="40" maxlength="50">
    > </b></p>
    > <input type="submit" value="Download" />
    > </form>
    >
    >
    >

    Familie Horsch Nieuws \(Zonnet\) Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139