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. File upload without user interaction

File upload without user interaction

Scheduled Pinned Locked Moved ASP.NET
tutorial
5 Posts 3 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.
  • H Offline
    H Offline
    horvat
    wrote on last edited by
    #1

    How to upload a file without user interaction, if I know the exact file path. I don't want to click Browse button for every file I wan't to upload. :confused:

    P 1 Reply Last reply
    0
    • H horvat

      How to upload a file without user interaction, if I know the exact file path. I don't want to click Browse button for every file I wan't to upload. :confused:

      P Offline
      P Offline
      Paul Watson
      wrote on last edited by
      #2

      I have not tried this but you could try and use JavaScript to set the FILE input element to the exact path and filename you want to upload. Then use JavaScript again to submit the form. You do still need the form and you still do need the FILE input.

      Paul Watson
      Bluegrass
      Cape Town, South Africa

      brianwelsch wrote: I find my day goes by more smoothly if I never question other peoples fantasies. My own disturb me enough.

      Richard DeemingR H 2 Replies Last reply
      0
      • P Paul Watson

        I have not tried this but you could try and use JavaScript to set the FILE input element to the exact path and filename you want to upload. Then use JavaScript again to submit the form. You do still need the form and you still do need the FILE input.

        Paul Watson
        Bluegrass
        Cape Town, South Africa

        brianwelsch wrote: I find my day goes by more smoothly if I never question other peoples fantasies. My own disturb me enough.

        Richard DeemingR Offline
        Richard DeemingR Offline
        Richard Deeming
        wrote on last edited by
        #3

        I would suspect that doesn't work - just think of the security implications if any site you visit can upload any file from your machine to their server. :eek:


        "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

        "These people looked deep within my soul and assigned me a number based on the order in which I joined" - Homer

        P 1 Reply Last reply
        0
        • Richard DeemingR Richard Deeming

          I would suspect that doesn't work - just think of the security implications if any site you visit can upload any file from your machine to their server. :eek:


          "These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer

          P Offline
          P Offline
          Paul Watson
          wrote on last edited by
          #4

          Richard Deeming wrote: I would suspect that doesn't work - just think of the security implications if any site you visit can upload any file from your machine to their server I know, but I have the best hopes for the intentions of the poster :) You are right though, just been fiddling and the simple way does not work. However I suspect that if you focus the FILE input and then simulate keypresses you can make it work. Anyone know how to simulate keypresses using JavaScript?

          Paul Watson
          Bluegrass
          Cape Town, South Africa

          brianwelsch wrote: I find my day goes by more smoothly if I never question other peoples fantasies. My own disturb me enough.

          1 Reply Last reply
          0
          • P Paul Watson

            I have not tried this but you could try and use JavaScript to set the FILE input element to the exact path and filename you want to upload. Then use JavaScript again to submit the form. You do still need the form and you still do need the FILE input.

            Paul Watson
            Bluegrass
            Cape Town, South Africa

            brianwelsch wrote: I find my day goes by more smoothly if I never question other peoples fantasies. My own disturb me enough.

            H Offline
            H Offline
            horvat
            wrote on last edited by
            #5

            Could you write me some sample code, how to do this?

            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