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. General Programming
  3. C#
  4. Sending byte array(data) to a URL with POST or GET

Sending byte array(data) to a URL with POST or GET

Scheduled Pinned Locked Moved C#
questionphpdatabasecomdata-structures
7 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.
  • U Offline
    U Offline
    User 4414712
    wrote on last edited by
    #1

    Hello. Im having a picture on my computer etc named "Hello.jpg", and I want to send it to a homepage etc http://mysite.com/image.php which then saves it to a blob columm in a database. I tried to do a simple GET with the byte array that contains the picture, but of course it doesn't save the whole image just with http://mysite.com/image.php?image=bytearray How can I solve this problem? Thx

    L L 2 Replies Last reply
    0
    • U User 4414712

      Hello. Im having a picture on my computer etc named "Hello.jpg", and I want to send it to a homepage etc http://mysite.com/image.php which then saves it to a blob columm in a database. I tried to do a simple GET with the byte array that contains the picture, but of course it doesn't save the whole image just with http://mysite.com/image.php?image=bytearray How can I solve this problem? Thx

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Not enough information. If GET-ing like that the data should obviously be URL-encoded, but what does the PHP script expect? Perhaps a POST instead of a GET? Maybe with base64 encoded data? We don't know - do you.

      U 1 Reply Last reply
      0
      • L Lost User

        Not enough information. If GET-ing like that the data should obviously be URL-encoded, but what does the PHP script expect? Perhaps a POST instead of a GET? Maybe with base64 encoded data? We don't know - do you.

        U Offline
        U Offline
        User 4414712
        wrote on last edited by
        #3

        Haven't really created the PHP script yet. I'm not having any specific idea how to do it. I'm looking for an idea and some help how to fix it. But yes, a post to the site will be as useful as a GET. I'm looking and searching for ideas. Google didn't help me very much this time :)

        L 1 Reply Last reply
        0
        • U User 4414712

          Haven't really created the PHP script yet. I'm not having any specific idea how to do it. I'm looking for an idea and some help how to fix it. But yes, a post to the site will be as useful as a GET. I'm looking and searching for ideas. Google didn't help me very much this time :)

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          Ok so you don't know either, because no one knows, so well.. PHP should make this pretty easy, but I'm not really into PHP - I hope someone else here will say something sensible about it :)

          1 Reply Last reply
          0
          • U User 4414712

            Hello. Im having a picture on my computer etc named "Hello.jpg", and I want to send it to a homepage etc http://mysite.com/image.php which then saves it to a blob columm in a database. I tried to do a simple GET with the byte array that contains the picture, but of course it doesn't save the whole image just with http://mysite.com/image.php?image=bytearray How can I solve this problem? Thx

            L Offline
            L Offline
            Luc 648011
            wrote on last edited by
            #5

            Member 4417892 wrote:

            How can I solve this problem?

            by showing some initiative. if you google for "php file upload" you can find lots of interesting things such as this one[^] which I have not read nor tried. :)

            U 1 Reply Last reply
            0
            • L Luc 648011

              Member 4417892 wrote:

              How can I solve this problem?

              by showing some initiative. if you google for "php file upload" you can find lots of interesting things such as this one[^] which I have not read nor tried. :)

              U Offline
              U Offline
              User 4414712
              wrote on last edited by
              #6

              Yeah, that kind of upload I have :) The question is more like, how can I write a C# application that postes a file to that php script?

              L 1 Reply Last reply
              0
              • U User 4414712

                Yeah, that kind of upload I have :) The question is more like, how can I write a C# application that postes a file to that php script?

                L Offline
                L Offline
                Luc 648011
                wrote on last edited by
                #7

                One more Google action (httprequest file upload) results in a lot, including a CP article which looks great: UploadFileEx: C#'s WebClient.UploadFile with more functionality[^] Stop being lazy, start searching yourself. :)

                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