Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. how to set value to htmlinput control(type = file)

how to set value to htmlinput control(type = file)

Scheduled Pinned Locked Moved ASP.NET
helptutorial
5 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    absprogrammer
    wrote on last edited by
    #1

    hi, i've browse option using if i write code txtoutputpath.value = "c:\aspfile.txt" then compiler give error but i want set a value to 'txtoutputpath' but i cant do it . how can set value to 'txtoutputpath' thnks in advance

    T 1 Reply Last reply
    0
    • A absprogrammer

      hi, i've browse option using if i write code txtoutputpath.value = "c:\aspfile.txt" then compiler give error but i want set a value to 'txtoutputpath' but i cant do it . how can set value to 'txtoutputpath' thnks in advance

      T Offline
      T Offline
      ToddHileHoffer
      wrote on last edited by
      #2

      I don't think you can set a value of a file input. It doesn't work that way, the user has to post a file. "People who never make mistakes, never do anything." My Blog

      A D 2 Replies Last reply
      0
      • T ToddHileHoffer

        I don't think you can set a value of a file input. It doesn't work that way, the user has to post a file. "People who never make mistakes, never do anything." My Blog

        A Offline
        A Offline
        absprogrammer
        wrote on last edited by
        #3

        thanx. i'm using asp.net using lang=vb.net then does any control/component available in asp.net ?

        G 1 Reply Last reply
        0
        • T ToddHileHoffer

          I don't think you can set a value of a file input. It doesn't work that way, the user has to post a file. "People who never make mistakes, never do anything." My Blog

          D Offline
          D Offline
          Daniel Santillanes
          wrote on last edited by
          #4

          As ToddHileHoffer said, and in some other message this was discussed before. If you make a post, and then you find there's something wrong in the form, and then you return to correct the problem, the file input won't hold it's 'value' (the path to the file) so what you need to do, is have this file selection until you have everything validated. daniero

          1 Reply Last reply
          0
          • A absprogrammer

            thanx. i'm using asp.net using lang=vb.net then does any control/component available in asp.net ?

            G Offline
            G Offline
            Guffa
            wrote on last edited by
            #5

            No, there isn't. There is only one field in html that does file uploads, and there is no way at all to set the value of that field. You can't do it using server code, you can't do it using html, and you can't do it using javascript. --- b { font-weight: normal; }

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups