The following forum(s) are migrating to a new home on Microsoft Q&A (Preview): Developing Universal Windows apps!

Ask new questions on Microsoft Q&A (Preview).
Interact with existing posts until December 13, 2019, after which content will be closed to all new and existing posts.

Learn More

 none
C# UWP UploadOperation BackgroundUploader Unable to find response RRS feed

  • Question

  •                       

    Unable to find json response in result and response information..where can i get this response...

    i want json response that return by server..

    I am trying to upload file to my server.. and its return upload data in json format..

    string boundray = "---------------------------" + DateTime.Now.Ticks.ToString("x"); string url = HttpDomainHandling(currentUser.DomainURL) + API + "&is_multi_part_upload=true"; string header = string.Format("--{0}\r\nContent-Dis-data; name=\"{1}\"; filename=\"{2}\"\r\n" + "Content-Type: {3}\r\n\r\n", boundray, "file", file.Name, "application/octet-stream"); string footer = string.Format("\r\n--{0}--\r\n", boundray); Stream headerStream = GenerateStreamFromString(header); Stream footerStream = GenerateStreamFromString(footer); Stream dataStream = await sfile.OpenStreamForReadAsync(); MemoryStream fileDataStream = new MemoryStream(); await headerStream.CopyToAsync(fileDataStream); await dataStream.CopyToAsync(fileDataStream); await footerStream.CopyToAsync(fileDataStream); fileDataStream.Position = 0; IInputStream stream = fileDataStream.AsInputStream(); BackgroundUploader backgroundUploader = new BackgroundUploader(); backgroundUploader.SetRequestHeader("Content-Type", "multipart/form-data; boundary=" + boundray); backgroundUploader.SetRequestHeader("Cookie", Constants.FELIXSESSIONID + "=" + currentUser.SessionID); backgroundUploader.Method = "POST"; UploadOperation uploadOpration = await backgroundUploader.CreateUploadFromStreamAsync(new Uri(url), stream); await Task.Factory.StartNew(() => CheckUploadStatus(uploadOpration, progressEvent, cts)); var result = await uploadOpration.StartAsync(); ResponseInformation info = uploadOpration.GetResponseInformation(); return info;


    Thursday, June 13, 2019 11:05 AM

All replies

  • Hi,

    >>Unable to find json response in result and response information

    Do you have any exceptions for this? Or it just no response when you request? Could you confirm the server had received the request and response to the request correctly?

    Best regards,

    Roy


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, June 14, 2019 2:55 AM
    Moderator