azure - Getting a 400 when saving metadata -
i've created .net web application, upload files azure storage blobs.
this works fine however, goes wrong when add together specific metadata tag. if add together "description" metadata tag quite big value (tested ~425 characters long) receive 400 bad request error. when manually azure management portal there no problems.
code used:
blob.metadata["description"] = "lorem ipsum dolor sit down amet, consectetur adipiscing elit. nam non nisi suscipit, dignissim nibh quis, imperdiet metus. donec elementum nunc nec mi mollis, eget rhoncus lorem aliquam. sed gravida, elit @ elementum euismod, ligula arcu viverra mauris, consectetur commodo sem dui id tortor. duis rutrum libero @ ante tincidunt posuere. aliquam turpis arcu, pellentesque ac purus vitae, eleifend consectetur lectus imperdiet ornare."; blob.setmetadata();
sincerely, luke
edit: gives 400 error instead of 403. (bad request instead of forbidden)
edit 2: after more testing figured out puts '\n' characters in string. somehow causing problems. (it still allowed in azure management portal)
the final problem not take escape charaters. fixed issue encoding , decoding string.
convert.tobase64string(encoding.utf8.getbytes("some value \n in it."));
and back
encoding.utf8.getstring(convert.frombase64string("u29tzsb2ywx1zsb3axroigegcibpbibpdc4="));
this solves problem. support. (gaurav mantri)
azure windows-azure-storage azure-storage-blobs
No comments:
Post a Comment