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. Uploading a file

Uploading a file

Scheduled Pinned Locked Moved ASP.NET
sysadminquestion
12 Posts 6 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.
  • D Offline
    D Offline
    dptalt
    wrote on last edited by
    #1

    I want to programatically upload a file from the local computer to the server without any intervention from the user. I tried using the FileUpload control but it requires the user to click the browse button to select a file. Can't I programatically set the file to be uploaded? Or is there another way to do this?

    M A D A 4 Replies Last reply
    0
    • D dptalt

      I want to programatically upload a file from the local computer to the server without any intervention from the user. I tried using the FileUpload control but it requires the user to click the browse button to select a file. Can't I programatically set the file to be uploaded? Or is there another way to do this?

      M Offline
      M Offline
      Manas Bhardwaj
      wrote on last edited by
      #2

      dptalt wrote:

      without any intervention from the user

      Leave alone the implementation, tell me how you plan to decide which file needs to uploaded.

      Manas Bhardwaj Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.

      A D 2 Replies Last reply
      0
      • M Manas Bhardwaj

        dptalt wrote:

        without any intervention from the user

        Leave alone the implementation, tell me how you plan to decide which file needs to uploaded.

        Manas Bhardwaj Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.

        A Offline
        A Offline
        Abhijit Jana
        wrote on last edited by
        #3

        Manas Bhardwaj wrote:

        tell me how you plan to decide which file needs to uploaded.

        Using Artificial Intelligence ;P

        Abhijit Jana | Codeproject MVP Web Site : abhijitjana.net Don't forget to click "Good Answer" on the post(s) that helped you.

        M S 2 Replies Last reply
        0
        • D dptalt

          I want to programatically upload a file from the local computer to the server without any intervention from the user. I tried using the FileUpload control but it requires the user to click the browse button to select a file. Can't I programatically set the file to be uploaded? Or is there another way to do this?

          A Offline
          A Offline
          Abhijit Jana
          wrote on last edited by
          #4

          dptalt wrote:

          it requires the user to click the browse button to select a file.

          Yes It should be !

          dptalt wrote:

          Can't I programatically set the file to be uploaded? Or is there another way to do this?

          Is it a fix file ? If yes, you can try it using ActiveX Components. But it will work only on IE.

          Abhijit Jana | Codeproject MVP Web Site : abhijitjana.net Don't forget to click "Good Answer" on the post(s) that helped you.

          1 Reply Last reply
          0
          • A Abhijit Jana

            Manas Bhardwaj wrote:

            tell me how you plan to decide which file needs to uploaded.

            Using Artificial Intelligence ;P

            Abhijit Jana | Codeproject MVP Web Site : abhijitjana.net Don't forget to click "Good Answer" on the post(s) that helped you.

            M Offline
            M Offline
            Manas Bhardwaj
            wrote on last edited by
            #5

            Abhijit Jana wrote:

            Artificial Intelligence

            Or Born negligence :) (I did not want to use exact word here ;P )

            Manas Bhardwaj Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.

            A 1 Reply Last reply
            0
            • M Manas Bhardwaj

              dptalt wrote:

              without any intervention from the user

              Leave alone the implementation, tell me how you plan to decide which file needs to uploaded.

              Manas Bhardwaj Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.

              D Offline
              D Offline
              dptalt
              wrote on last edited by
              #6

              The file name and path to be uploaded is stored in a session variable. In the code behind I would like to have a method that uploads this file.

              A 1 Reply Last reply
              0
              • D dptalt

                The file name and path to be uploaded is stored in a session variable. In the code behind I would like to have a method that uploads this file.

                A Offline
                A Offline
                Abhijit Jana
                wrote on last edited by
                #7

                dptalt wrote:

                The file name and path to be uploaded is stored in a session variable.

                From where these file name will come to session variable ?

                Abhijit Jana | Codeproject MVP Web Site : abhijitjana.net Don't forget to click "Good Answer" on the post(s) that helped you.

                1 Reply Last reply
                0
                • M Manas Bhardwaj

                  Abhijit Jana wrote:

                  Artificial Intelligence

                  Or Born negligence :) (I did not want to use exact word here ;P )

                  Manas Bhardwaj Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.

                  A Offline
                  A Offline
                  Abhijit Jana
                  wrote on last edited by
                  #8

                  Manas Bhardwaj wrote:

                  I did not want to use exact word here

                  :rolleyes:

                  Abhijit Jana | Codeproject MVP Web Site : abhijitjana.net Don't forget to click "Good Answer" on the post(s) that helped you.

                  1 Reply Last reply
                  0
                  • A Abhijit Jana

                    Manas Bhardwaj wrote:

                    tell me how you plan to decide which file needs to uploaded.

                    Using Artificial Intelligence ;P

                    Abhijit Jana | Codeproject MVP Web Site : abhijitjana.net Don't forget to click "Good Answer" on the post(s) that helped you.

                    S Offline
                    S Offline
                    sashidhar
                    wrote on last edited by
                    #9

                    Abhijit Jana wrote:

                    Using Artificial Intelligence

                    :omg: :cool::confused::rose::cool:

                    If It Helps Click It as Answer

                    A 1 Reply Last reply
                    0
                    • S sashidhar

                      Abhijit Jana wrote:

                      Using Artificial Intelligence

                      :omg: :cool::confused::rose::cool:

                      If It Helps Click It as Answer

                      A Offline
                      A Offline
                      Abhijit Jana
                      wrote on last edited by
                      #10

                      :jig: :badger: :jig:

                      Abhijit Jana | Codeproject MVP Web Site : abhijitjana.net Don't forget to click "Good Answer" on the post(s) that helped you.

                      1 Reply Last reply
                      0
                      • D dptalt

                        I want to programatically upload a file from the local computer to the server without any intervention from the user. I tried using the FileUpload control but it requires the user to click the browse button to select a file. Can't I programatically set the file to be uploaded? Or is there another way to do this?

                        D Offline
                        D Offline
                        droth17
                        wrote on last edited by
                        #11

                        That would violate just a few security protocols. Just imagine the risks if browsers just allowed websites to upload documents to the server without user input.

                        1 Reply Last reply
                        0
                        • D dptalt

                          I want to programatically upload a file from the local computer to the server without any intervention from the user. I tried using the FileUpload control but it requires the user to click the browse button to select a file. Can't I programatically set the file to be uploaded? Or is there another way to do this?

                          A Offline
                          A Offline
                          Abhishek Sur
                          wrote on last edited by
                          #12

                          Jokes apart. Its not possible. There is no possibility to have input type="file" control to set the value without human intervention. Even you cannot copy the input type="file" control. Thus if you create a dynamic form and copy the control to that form and send.. it wont be possible. So forget about this.. Moreover you can do one thing, is to programmatically open the File browser dialog... :-D :-D

                          Abhishek Sur


                          My Latest Articles **Create CLR objects in SQL Server 2005 C# Uncommon Keywords Read/Write Excel using OleDB

                          **Don't forget to click "Good Answer" if you like to.

                          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