1

My requirement is to post an uploaded file to the Signak R Hub method from the Js where we call the

testProcessServer.server.uploadFileValidation();

To the "UploadFileValidation" , I want to send the File being uploaded. But using the HttpContext.Current.Request.Files["Name"] is giving null.

                var uploadFile = new FormData();
                var files = $("#prFileUploader").get(0).files;
                // Add the uploaded file content to the form data collection
                if (files.length > 0) {
                    //get folder icon id
                    uploadFile.append("CsvDoc", files[0]);
                  }

Please suggest here, what should be used so that I can get the file contents in the Method inside the Signal R Hub.cs file.

Thank You

tereško
  • 58,060
  • 25
  • 98
  • 150
  • Have you seen this answer? http://stackoverflow.com/a/10003710/25702 – David Gardiner Aug 20 '15 at 12:10
  • Yes David, I want to just get the file on the server and get the contents, not upload and save on server – Passion Coding Aug 20 '15 at 12:16
  • 1
    @SurajSahoo SignalR is not for those purposes. What you are trying to do is like killing pigeons with atomic rocket. If you are thinking about doing so then you completely don't understand what SignalR is built for. – Maris Aug 20 '15 at 12:23
  • 2
    possible duplicate of [ASP.NET MVC - Upload a file with SignalR](http://stackoverflow.com/questions/9999950/asp-net-mvc-upload-a-file-with-signalr) – radu-matei Aug 20 '15 at 21:39
  • You say "I want to just get the file on the server" - that *is* uploading the file. – David Gardiner Aug 21 '15 at 00:56

0 Answers0