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. read byte of saved picture

read byte of saved picture

Scheduled Pinned Locked Moved ASP.NET
11 Posts 4 Posters 1 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.
  • C comptech2

    hi.i want to read byte of save picture and show in fileUpload control.the below code dont work.please quidance me

    while (dr.Read())
    {
    picture_fileUpload = (byte[])dr["picture"];
    }

    N Offline
    N Offline
    Not Active
    wrote on last edited by
    #2

    You can't assign a value to an upload control. What are you trying to accomplish?


    Failure is not an option; it's the default selection.

    C 1 Reply Last reply
    0
    • C comptech2

      hi.i want to read byte of save picture and show in fileUpload control.the below code dont work.please quidance me

      while (dr.Read())
      {
      picture_fileUpload = (byte[])dr["picture"];
      }

      S Offline
      S Offline
      satalaj
      wrote on last edited by
      #3

      Hi, Asp.net fileUpload control has FileBytes properties. It returns file content in terms of byte array. Upload image file and save in sql server.

      C N 2 Replies Last reply
      0
      • N Not Active

        You can't assign a value to an upload control. What are you trying to accomplish?


        Failure is not an option; it's the default selection.

        C Offline
        C Offline
        comptech2
        wrote on last edited by
        #4

        this is edit page and i want that fileupload kept last image value and if we select new image then change its value

        N 1 Reply Last reply
        0
        • S satalaj

          Hi, Asp.net fileUpload control has FileBytes properties. It returns file content in terms of byte array. Upload image file and save in sql server.

          C Offline
          C Offline
          comptech2
          wrote on last edited by
          #5

          this is edit page and i want that fileupload kept last image value and if we select new image then change its value

          S 1 Reply Last reply
          0
          • C comptech2

            this is edit page and i want that fileupload kept last image value and if we select new image then change its value

            N Offline
            N Offline
            Not Active
            wrote on last edited by
            #6

            So display the existing image and check the FileUpload.HasFile property. If true then the user has selected a new file to be uploaded. Why make it more difficult?


            Failure is not an option; it's the default selection.

            C 1 Reply Last reply
            0
            • S satalaj

              Hi, Asp.net fileUpload control has FileBytes properties. It returns file content in terms of byte array. Upload image file and save in sql server.

              N Offline
              N Offline
              Not Active
              wrote on last edited by
              #7

              Did you read the question?


              Failure is not an option; it's the default selection.

              1 Reply Last reply
              0
              • N Not Active

                So display the existing image and check the FileUpload.HasFile property. If true then the user has selected a new file to be uploaded. Why make it more difficult?


                Failure is not an option; it's the default selection.

                C Offline
                C Offline
                comptech2
                wrote on last edited by
                #8

                but how to set the value to file upload control during postback ?

                N 1 Reply Last reply
                0
                • C comptech2

                  but how to set the value to file upload control during postback ?

                  N Offline
                  N Offline
                  Not Active
                  wrote on last edited by
                  #9

                  You DON'T set it. How many times do you need to be told this?


                  Failure is not an option; it's the default selection.

                  1 Reply Last reply
                  0
                  • C comptech2

                    this is edit page and i want that fileupload kept last image value and if we select new image then change its value

                    S Offline
                    S Offline
                    shreekar
                    wrote on last edited by
                    #10

                    OK - lets do it one step at a time. Have you managed to save the uploaded image to wherever you want?

                    Shreekar

                    N 1 Reply Last reply
                    0
                    • S shreekar

                      OK - lets do it one step at a time. Have you managed to save the uploaded image to wherever you want?

                      Shreekar

                      N Offline
                      N Offline
                      Not Active
                      wrote on last edited by
                      #11

                      Have you even read this thread? The first post shows the OP is obtaining the image from a database. The question isn't about uploading an image.


                      Failure is not an option; it's the default selection.

                      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