fix uploading files
This commit is contained in:
parent
ef516ce396
commit
42fb1e5c0a
|
@ -110,7 +110,7 @@ Future<void> _postOnMastodon(reqJson) async {
|
||||||
|
|
||||||
for (final photoUrl in photoUrls) {
|
for (final photoUrl in photoUrls) {
|
||||||
final resp = await dio.post('$instanceUrl/api/v1/media',
|
final resp = await dio.post('$instanceUrl/api/v1/media',
|
||||||
data: dio_lib.FormData.fromMap({'file': File(photoUrl)}),
|
data: dio_lib.FormData.fromMap({'file': dio_lib.MultipartFile.fromFileSync(photoUrl)}),
|
||||||
options:
|
options:
|
||||||
dio_lib.Options(headers: {'Authorization': 'Bearer $authToken'}));
|
dio_lib.Options(headers: {'Authorization': 'Bearer $authToken'}));
|
||||||
mediaIds.add(resp.data['id']);
|
mediaIds.add(resp.data['id']);
|
||||||
|
|
Loading…
Reference in a new issue