最近要傳圖片給特定的USER試了一下後,在USER在LINE上面看,圖片解析度很差,下載後也是一樣
下面是我要傳的圖片格式 size是2.2mb
使用的TOOL是C#,請問這是line的限制還是說程式部份能怎麼調整呢?
var file = ImagePath;//圖檔位置
var upfilebytes = File.ReadAllBytes(file);
Url = Url + string.Format("?message=\r\n{0}", Msg);//組訊息
foreach (string to in lstToken)
{
try
{
HttpClientHandler handler = new HttpClientHandler();
HttpClient Client = new HttpClient(handler);
Client.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", to); //Token
MultipartFormDataContent content = new MultipartFormDataContent();
ByteArrayContent baContent = new ByteArrayContent(upfilebytes);
content.Add(baContent, "imageFile", "tmp");
var response = Client.PostAsync(Url, content).Result;
handler.Dispose();
Client.Dispose();
baContent.Dispose();
content.Dispose();
}
catch (Exception ex)
{
ErrMsg(ttbLog, string.Format("Send Token:{0} SendNotify_Image fail, ex:{1}", to, ex.Message));
}
}
upfilebytes = null;