2017-05-27 8 views
0

これはかなりばかげた質問ですが、標準ライブラリとSimpleJSONを使用することは可能ですか?SimpleJSONアップロードのみを使用し、テレグラムで写真を送信できますか? C#

+0

はい。 Convert.ToBase64String(byte []) – jdweng

+0

これは動作しません。Convert.ToBase64Stringを使用している場合は、写真にのみのパスがあります。エラーが発生しました(タイプを変換しています)。 "string"から "byte []"への変換は不可能です)。 –

+0

Convertを使用する前に、写真をバイト[]に変換する必要があります。 – jdweng

答えて

1

はい。 this document

There are three ways to send files (photos, stickers, audio, media, etc.):

1.If the file is already stored somewhere on the Telegram servers, you don't need to reupload it: each file object has a file_id field, simply pass this file_id as a parameter instead of uploading. There are no limits for files sent this way.

2.Provide Telegram with an HTTP URL for the file to be sent. Telegram will download and send the file. 5 MB max size for photos and 20 MB max for other types of content.

3.Post the file using multipart/form-data in the usual way that files are uploaded via the browser. 10 MB max size for photos, 50 MB for other files.

3つ目の方法が欲しいものです。

+0

これはどうやってですか?私は例を検索することはできません。 –

+0

@МаксимЮкифаговあなたはファイルをアップロードするために検索する必要があります、それは別の質問です – Sean

関連する問題