Answer the question
In order to leave comments, you need to log in
How to fix an error when uploading a photo to VK?
Basically I get the upload address via photos.getMessagesUploadServer
Then I use this:
var UplJs = JsonConvert.DeserializeObject(UplServer);
It turns out the following:
{
"server": 204616,
"photo": "[{\"markers_restarted\":true,\"photo\":\"49e69a58af:z\",\"sizes\":[],\"latitude\":0,\"longitude\ ":0,\"kid\":\"563d3a8d49c3c571296a954afc43ea8a\",\"sizes2\":, \ "urls \": [], \ "urls2 \": [\ "1TNBzA4LMbHKVBwLyiQwTUoS83Dh2z2djp1yug / zgCsgoohG4I.jpg \", \ "qfT5Slojtw8tl7AYdJcKwjhjtlADozjyDe9haQ / cgjjmNgVZCs.jpg \", \ "KseW23XJuALKa_HMR40MK7E-8j1jFzXGCXNzJw / DqyycEyy5d8.jpg \ ", \" wOdmB0rVtugRkyxbGnZIFOXUIs8WLwvpIr3mHg / 3AOVODNQgrs.jpg \ ", \" YfnFADi5aV5bqrww6Z3vW1yVOXjVB-p07CbRWQ / R77ObjtNeZM.jpg \ ", \" HC1THbleHd7buVT_Wa0VnuAHLUUg3wEvS-3Faw / 6osEp6M2Rr0.jpg \ ", \" Ww_AgxQefv9mG0FHXIj1pzGYBcMLAS-zzyDW8g / ciCqAywxV68.jpg\",\"2V8lJQQWi4oId0RqKxrNcmx_XrRgC_FpahAa4w/DPJcESwuvuw.jpg\",\"7v_npbBE7eqMKaiVpsgR9kQyp9gIhEt1_lNpkQ/FUSkXpESahQ.jpg\"]}]",\"7v_npbBE7eqMKaiVpsgR9kQyp9gIhEt1_lNpkQ/FUSkXpESahQ.jpg\"]}]",\"7v_npbBE7eqMKaiVpsgR9kQyp9gIhEt1_lNpkQ/FUSkXpESahQ.jpg\"]}]",
"hash": "cba222d52a04d9b160b701616f6138f3"
}
But then when I write this:
VKserver.APIRequest("photos.saveMessagesPhoto", UplJs , this.tk, "");
I get the error photo is undefined
If I try to register individually:
VKserver.APIRequest("photos.saveMessagesPhoto", "photo=" + uplphoto + "&server=" + uplserver + "&hash=" + uplhash, this.tk, " ");
Then the following error comes out:
photos_list is invalid
And separately, I tried to separate the text, so that it turned out like here in the VK documentation example:
{
"server": 626627,
"photo":"[{\"photo\":\"190ab6eadf:w\",\"sizes\":[[\"s\",\"626627852\",\"e6a3\",\"lMU557Tx -78\",75.56],[\"m\",\"626627852\",\"e6a4\",\"hq8g5CzPmXs\",130.97],[\"x\",\"626627852 \",\"e6a5\",\"c-_TPYB_rIU\",604,453],\"kid\":\"72cfb87071e2d6624a38167524d5b4aa\",\"debug\":\"xswmwxwywzwwwowpwqwrw\"}]",
"hash" :"581d7a4ffc81e2bfe90016d8b35c288d"
}
I removed those curly brackets, I removed the quotes, which I just didn't try, there was an error photos_list is invalid everywhere
How do I fix this?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question