How to send an object using BackgroundUploader? RRS feed

  • Question

  • Hi All,

    I am trying to upload an object contains one File and some string values (Object details are mentioned below) using backgrounduploader class. but I am unable to upload it using backgrounduploader. It is considering only File to upload  to the service.

    Object details :
    public class Pictures
            public string PictureName { get; set; }
            public StorageFile file { get; set; }
            public string username{ get; set; }
            public string senderName { get; set; }
            public string receiverName { get; set; }


    BackgroundUploader uploader = new BackgroundUploader();
                uploader.SetRequestHeader("Filename", file.Name);
                uploader.Method = "POST";
                UploadOperation upload = uploader.CreateUpload(uri, file);

    as shown in the above, I need to send an object instead of file.

    Is there any other mechanism to perform this operation? Could anyone please help me to figure out this problem?

    Thanks in advance.

    Friday, December 26, 2014 6:03 AM


  • You should package everything into a file (zip would work well) and send it together.

    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    Friday, December 26, 2014 2:38 PM