Example #1
0
 protected override void prepareRemoveData(HTTPManager.HTTPRequest http)
 {
     if (Id != 0)
     {
         http.addParameter("id", Id);
     }
 }
Example #2
0
        protected override void prepareSaveData(HTTPManager.HTTPRequest http)
        {
            string base64string = Convert.ToBase64String(FileBody);

            chucksCount = (int)Math.Ceiling((double)(base64string.Length / chuckSize));
            if (chucksCount < 2)
            {
                http.addParameter("file", base64string);
            }
            else
            {
                for (int i = 0; i < chucksCount; i++)
                {
                    int pos = (i * chuckSize);

                    if (i == chucksCount - 1)
                    {
                        chucks.Add(base64string.Substring(pos));
                    }
                    else
                    {
                        chucks.Add(base64string.Substring(pos, chuckSize));
                    }
                }
                http.addParameter("file", chucks[0]);
            }

            http.addParameter("name", Name);
            http.addParameter("id_bid", Id_bid);
            http.addParameter("ext", Ext);
            if (Id != 0)
            {
                http.addParameter("id", Id);
            }
            if (chucks.Count > 0)
            {
                chucks.RemoveAt(0);
            }
        }