Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

<!--WLANSDFILE-->の置き換えについて #17

Open
Hundredsoft opened this issue Feb 18, 2016 · 0 comments
Open

<!--WLANSDFILE-->の置き換えについて #17

Hundredsoft opened this issue Feb 18, 2016 · 0 comments

Comments

@Hundredsoft
Copy link

https://flashair-developers.com/ja/documents/api/lua/reference/#request
のファイルアップロードのサンプルコードから、xight/flashair-lua-devを呼び出したが、通信が完了しない。
(CentOS 6.7 x86)

「引数bodyに、が記述された場合、置き換えで、file内容を埋め込む」
というFlashAir独自仕様が満たされていないように思います。

少し、冗長ですが

65a66,78

  -- Hundredsoft add start
  if (file ~= nil) then
      local fp = io.open(file, "rb")
      if (fp ~= nil) then
          local r1, r2 = string.match(reqbody, "(.-)%<%!%-%-WLANSDFILE%-%-%>(.+)")
          if (r1 ~= nil and r2 ~= nil) then
              reqbody = r1 .. fp:read("*a") .. r2
          end
          fp:close()
      end
  end
  -- Hundredsoft add end

で、改善できるのではないでしょうか。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant