SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Wizard
    Join Date
    Jan 2005
    Location
    blahblahblah
    Posts
    1,447
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    upload form question

    Hi,
    I have a question about forms whose purpose is to let users upload something, the ones with the enctype attributes. They usually team with <input> tags having an file attribute set to "file".

    Now what if I have 10 fields and only one is a of a type "file". Do I have to create 2 separate forms or are all the "text" type fields handled as usual, just the file type being different.


  2. #2
    SitePoint Wizard gold trophysilver trophybronze trophy dc dalton's Avatar
    Join Date
    Nov 2004
    Location
    Right behind you, watching, always watching.
    Posts
    5,431
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Your form tag should look like this:

    <form enctype='multipart/form-data' method='post' action='your_app'>

    then your regular inputs are done as usual but the one for your file upload should look like this:

    <input type='file' name='some_name' />

    besides that there is nothing special, all the fun stuff is handled in the server side app that grabs the data and does the uploading

  3. #3
    SitePoint Wizard
    Join Date
    Jan 2005
    Location
    blahblahblah
    Posts
    1,447
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks dc


Bookmarks

Posting Permissions

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