一部のAndroidでファイルのアップロードができないらしい

Issue #15 resolved
kyohey hamaguchi repo owner created an issue

たぶん標準ブラウザで。

https://twitter.com/bule6315/status/472943584702771200

Comments (5)

  1. kyohey hamaguchi reporter

    Experia ULなる機種での報告があった。こちらも標準ブラウザをご利用とのこと。 https://twitter.com/Minatoxx3710/status/475476687270858752

    試してみたら自分のHTC21か何かでも、Chromeではうまくいくのに標準ブラウザでは動かないことが確認できた。

    調べたところapplication/octet-streamで送信されていることがわかった。

    うまくいく例:

    Started POST "/chara/update" for 126.11.57.16 at 2014-06-08 15:22:27 +0900
    Processing by CharaController#update as HTML
      Parameters: {"utf8"=>"✓", "authenticity_token"=>"5s5K7lAvpMuJQMy1af0m6eH7R5OmRyonVu8EXgSl1Zs=", "name"=>"", "fullname"=>"", "readable"=>"", "world"=>"隠しキャラ含む", "age"=>"", "gender"=>"", "bloodtype"=>"", "punchline"=>"", "tags"=>"隠し", "desc"=>"", "avatar"=>#, @original_filename="IMAG0361.jpg", @content_type="image/jpeg", @headers="Content-Disposition: form-data; name=\"avatar\"; filename=\"IMAG0361.jpg\"\r\nContent-Type: image/jpeg\r\n">, "commit"=>"情報を更新", "chara_id"=>"4034"}
      User Load (0.9ms)  SELECT "users".* FROM "users" WHERE "users"."id" = 7 ORDER BY "users"."id" ASC LIMIT 1
      Chara Load (0.2ms)  SELECT "charas".* FROM "charas" WHERE "charas"."id" = ? LIMIT 1  [["id", "4034"]]
      CharaProfile Load (0.3ms)  SELECT "chara_profiles".* FROM "chara_profiles" WHERE "chara_profiles"."chara_id" = ? ORDER BY "chara_profiles"."id" ASC LIMIT 1  [["chara_id", 4034]]
       (0.2ms)  begin transaction
       (0.2ms)  commit transaction
      ActsAsTaggableOn::Tag Load (0.4ms)  SELECT "tags".* FROM "tags" INNER JOIN "taggings" ON "tags"."id" = "taggings"."tag_id" WHERE "taggings"."taggable_id" = ? AND "taggings"."taggable_type" = ? AND (taggings.context = 'tags' AND taggings.tagger_id IS NULL)  [["taggable_id", 4034], ["taggable_type", "Chara"]]
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
    1776170
    "/tmp/RackMultipart20140608-7917-1iq6qx7"
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
    Command :: file -b --mime-type '/tmp/5d73f01dfbe492b402039b1beb47beb920140608-7917-1eg7g2k'
    Command :: identify -format '%wx%h,%[exif:orientation]' '/tmp/6d8089f725a604f19ec8f0a1e1d7f61c20140608-7917-1cxoos0[0]' 2>/dev/null
    Command :: identify -format %m '/tmp/6d8089f725a604f19ec8f0a1e1d7f61c20140608-7917-1cxoos0[0]'
    Command :: convert '/tmp/6d8089f725a604f19ec8f0a1e1d7f61c20140608-7917-1cxoos0[0]' -auto-orient -resize "300x300>" '/tmp/6d8089f725a604f19ec8f0a1e1d7f61c20140608-7917-1cxoos020140608-7917-16s8tko'
    Command :: file -b --mime '/tmp/6d8089f725a604f19ec8f0a1e1d7f61c20140608-7917-1cxoos020140608-7917-16s8tko'
    Command :: identify -format '%wx%h,%[exif:orientation]' '/tmp/6d8089f725a604f19ec8f0a1e1d7f61c20140608-7917-1cxoos0[0]' 2>/dev/null
    Command :: identify -format %m '/tmp/6d8089f725a604f19ec8f0a1e1d7f61c20140608-7917-1cxoos0[0]'
    Command :: convert '/tmp/6d8089f725a604f19ec8f0a1e1d7f61c20140608-7917-1cxoos0[0]' -auto-orient -resize "100x100>" '/tmp/6d8089f725a604f19ec8f0a1e1d7f61c20140608-7917-1cxoos020140608-7917-1q9wq02'
    Command :: file -b --mime '/tmp/6d8089f725a604f19ec8f0a1e1d7f61c20140608-7917-1cxoos020140608-7917-1q9wq02'
       (0.9ms)  begin transaction
    Command :: file -b --mime-type '/tmp/36c80866fa5b92500c8e33def265826f20140608-7917-owgxiz'
    Binary data inserted for `string` type on column `avatar_content_type`
      SQL (4.1ms)  UPDATE "charas" SET "avatar_file_name" = ?, "avatar_content_type" = ?, "avatar_file_size" = ?, "avatar_updated_at" = ?, "updated_at" = ? WHERE "charas"."id" = 4034  [["avatar_file_name", "IMAG0361.jpg"], ["avatar_content_type", "image/jpeg"], ["avatar_file_size", 1776170], ["avatar_updated_at", Sun, 08 Jun 2014 15:22:27 JST +09:00], ["updated_at", Sun, 08 Jun 2014 15:22:31 JST +09:00]]
      ActsAsTaggableOn::Tag Load (1.0ms)  SELECT "tags".* FROM "tags" WHERE (LOWER(name) = LOWER('隠し'))
      ActsAsTaggableOn::Tag Load (0.5ms)  SELECT "tags".* FROM "tags" INNER JOIN "taggings" ON "tags"."id" = "taggings"."tag_id" WHERE "taggings"."taggable_id" = ? AND "taggings"."taggable_type" = ? AND (taggings.context = 'tags' AND taggings.tagger_id IS NULL)  [["taggable_id", 4034], ["taggable_type", "Chara"]]
    [paperclip] saving /charas/avatars/000/004/034/original/IMAG0361.jpg
    [AWS S3 200 1.213814 0 retries] put_object(:acl=>:public_read,:bucket_name=>"uchinoko-devel",:content_length=>1776170,:content_type=>"image/jpeg",:data=>Paperclip::UploadedFileAdapter: IMAG0361.jpg,:key=>"charas/avatars/000/004/034/original/IMAG0361.jpg")
    
    [paperclip] saving /charas/avat
    

    ダメな例:

    Started POST "/chara/update" for 126.11.57.16 at 2014-06-08 15:24:32 +0900
    Processing by CharaController#update as HTML
      Parameters: {"utf8"=>"✓", "authenticity_token"=>"qQAZdg0tSmV/26GcW/DFrfIHNuMiDVIPbyItxz26XaI=", "name"=>"from Standard Browser, HTC21", "fullname"=>"", "readable"=>"", "world"=>"隠しキャラ含む", "age"=>"", "gender"=>"", "bloodtype"=>"", "punchline"=>"", "tags"=>"隠し", "desc"=>"", "avatar"=>#, @original_filename="IMAG0361.jpg", @content_type="application/octet-stream", @headers="Content-Disposition: form-data; name=\"avatar\"; filename=\"IMAG0361.jpg\"\r\nContent-Type: application/octet-stream\r\n">, "private"=>"true", "commit"=>"情報を更新", "chara_id"=>"4036"}
      User Load (1.4ms)  SELECT "users".* FROM "users" WHERE "users"."id" = 7 ORDER BY "users"."id" ASC LIMIT 1
      Chara Load (0.3ms)  SELECT "charas".* FROM "charas" WHERE "charas"."id" = ? LIMIT 1  [["id", "4036"]]
      CharaProfile Load (0.2ms)  SELECT "chara_profiles".* FROM "chara_profiles" WHERE "chara_profiles"."chara_id" = ? ORDER BY "chara_profiles"."id" ASC LIMIT 1  [["chara_id", 4036]]
       (1.1ms)  begin transaction
       (0.2ms)  commit transaction
      ActsAsTaggableOn::Tag Load (0.3ms)  SELECT "tags".* FROM "tags" INNER JOIN "taggings" ON "tags"."id" = "taggings"."tag_id" WHERE "taggings"."taggable_id" = ? AND "taggings"."taggable_type" = ? AND (taggings.context = 'tags' AND taggings.tagger_id IS NULL)  [["taggable_id", 4036], ["taggable_type", "Chara"]]
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
    1776170
    "/tmp/RackMultipart20140608-7917-1aavsgk"
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
    Command :: file -b --mime-type '/tmp/89f98f9b693141663075ed3f421f8fe620140608-7917-1lhm6qq'
       (0.9ms)  begin transaction
    Command :: file -b --mime-type '/tmp/b17e8627b185f864c59d16dd8cac000820140608-7917-srus0s'
       (0.8ms)  rollback transaction
    Redirected to http://www.tnzk.org:8888/chara/show/4036
    Completed 302 Found in 191ms (ActiveRecord: 5.1ms)
    
  2. kyohey hamaguchi reporter

    application/octet-streamを許容するようにして報告を受けた4機種のうち3機種での解決を確認。残り1機種はまだお返事ないけど、たぶん大丈夫。

  3. Log in to comment