V
V
Vadim Frolov2015-10-29 13:50:23
Classmates
Vadim Frolov, 2015-10-29 13:50:23

How to upload a video via HTTP POST?

According to the documentation: https://apiok.ru/wiki/pages/viewpage.action?pageId... after downloading the video file from the HTML application (see the code below), the video should appear in "my videos".
Result: no, it doesn't appear. Although the response after downloading HTTP/1.1 200 OK 1. Permission "Access to video" (VIDEO_CONTENT) is, the user accepted.
What am I doing wrong?

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">	
<head>
    <title></title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <script type="text/javascript" src="//api.odnoklassniki.ru/js/fapi5.js" defer="defer"></script>
    <script type="text/javascript">
        function onReady() {
            var query   = FAPI.Util.getRequestParameters();
            
            FAPI.init(query["api_server"], query["apiconnection"],
                  function() {
                      FAPI.Client.call({
                            method: 'video.getUploadUrl',
                            file_name: 'video.mpeg',
                            file_size: 0,
                            attachment_type: 'MOVIE'
                      }, function(method, result, data) {
                            document.getElementById('uploadForm').action = result.upload_url;
                      });
                  },
                  function(error) {
                      alert("Ошибка инициализации " + error);
                  }
            );
        }    
    </script>
    
</head>
<body onload="onReady()">
    <h1>Upload TEST</h1>
    <form action="" enctype="multipart/form-data" method="POST" id="uploadForm">
        <input type="file" name="v1" accept="video/*" />
        <input type="submit" />
    </form>
</body>
</html>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Valery Ozhiganov, 2015-11-11
@vozhiganov

In the above dock, there is also a third stage, calling video.update

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question