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. SignalR Instant File Upload

SignalR Instant File Upload

Scheduled Pinned Locked Moved C#
json
6 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.
  • L Offline
    L Offline
    Liagapi
    wrote on last edited by
    #1

    I've always thought that SignalR does not support the transfer of binary data and although one can convert an image into a base64 string and send it, Websocket which SignalR uses, has a size limit of 64K. So every post online related to sending an image via SignalR says it cannot be done and that Web API should be used instead for that purpose. Having said all that, I came across a Youtube video which shows a person uploading an image in one browser and then instantaneously displaying it in another browser. Can someone explain how this can be possible

    P OriginalGriffO D 3 Replies Last reply
    0
    • L Liagapi

      I've always thought that SignalR does not support the transfer of binary data and although one can convert an image into a base64 string and send it, Websocket which SignalR uses, has a size limit of 64K. So every post online related to sending an image via SignalR says it cannot be done and that Web API should be used instead for that purpose. Having said all that, I came across a Youtube video which shows a person uploading an image in one browser and then instantaneously displaying it in another browser. Can someone explain how this can be possible

      P Offline
      P Offline
      Pete OHanlon
      wrote on last edited by
      #2

      Did the Youtube video explicitly state that they were using SignalR to accomplish this particular feature?

      This space for rent

      L 1 Reply Last reply
      0
      • L Liagapi

        I've always thought that SignalR does not support the transfer of binary data and although one can convert an image into a base64 string and send it, Websocket which SignalR uses, has a size limit of 64K. So every post online related to sending an image via SignalR says it cannot be done and that Web API should be used instead for that purpose. Having said all that, I came across a Youtube video which shows a person uploading an image in one browser and then instantaneously displaying it in another browser. Can someone explain how this can be possible

        OriginalGriffO Offline
        OriginalGriffO Offline
        OriginalGriff
        wrote on last edited by
        #3

        Liagapi wrote:

        Can someone explain how this can be possible

        Magic. Pixies. Video editing. Other. Since we have no idea what video you are talking about - and it's not a good idea to post youtube links here - we are hardly likely to know exactly what they did. The best person to ask is the person who made the video - I'm pretty sure that YouTube lets you comment on videos at the bottom of the page...

        Bad command or file name. Bad, bad command! Sit! Stay! Staaaay... AntiTwitter: @DalekDave is now a follower!

        "I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
        "Common sense is so rare these days, it should be classified as a super power" - Random T-shirt

        1 Reply Last reply
        0
        • L Liagapi

          I've always thought that SignalR does not support the transfer of binary data and although one can convert an image into a base64 string and send it, Websocket which SignalR uses, has a size limit of 64K. So every post online related to sending an image via SignalR says it cannot be done and that Web API should be used instead for that purpose. Having said all that, I came across a Youtube video which shows a person uploading an image in one browser and then instantaneously displaying it in another browser. Can someone explain how this can be possible

          D Offline
          D Offline
          Dave Kreskowiak
          wrote on last edited by
          #4

          I have no idea what video you're talking about, but based on your description and SignalR limitations, there are TWO channels at work here. The first is a normal upload of an image file by the browser to a web server, either through a web service, web api, POST, whatever. The server then sends a message to another SignalR client to tell it to download the image from the server using a specific URL. The image is NOT transferred via SignalR, but the messaging the tell the clients that an image was updated is.

          System.ItDidntWorkException: Something didn't work as expected. A guide to posting questions on CodeProject

          Click this: Asking questions is a skill. Seriously, do it.
          Dave Kreskowiak

          1 Reply Last reply
          0
          • P Pete OHanlon

            Did the Youtube video explicitly state that they were using SignalR to accomplish this particular feature?

            This space for rent

            L Offline
            L Offline
            Liagapi
            wrote on last edited by
            #5

            Hi Pete, yes the video description did say that SignalR was used but the video only shows the uploading and displaying of images but no code was shown. The name of the video is

            Real Time Image Uploading No Coding - SignalR

            P 1 Reply Last reply
            0
            • L Liagapi

              Hi Pete, yes the video description did say that SignalR was used but the video only shows the uploading and displaying of images but no code was shown. The name of the video is

              Real Time Image Uploading No Coding - SignalR

              P Offline
              P Offline
              Pete OHanlon
              wrote on last edited by
              #6

              It doesn't say what version of SignalR that person was using. The size limitation was introduced around about SignalR 2. You might be able to work around this by falling the connection back to HTTP Long Polling instead (you set that in the connection.start).

              This space for rent

              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