Skip to content

Commit

Permalink
fix oss upload image && php upload image
Browse files Browse the repository at this point in the history
  • Loading branch information
clown139880 committed Nov 24, 2019
1 parent cc1b2df commit 2cc409e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions dio/lib/src/form_data.dart
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,12 @@ class FormData {
/// contain only ASCII characters.
String _headerForFile(MapEntry<String, MultipartFile> entry) {
var file = entry.value;
var header = 'content-type: ${file.contentType}\r\n'
'content-disposition: form-data; name="${_browserEncode(entry.key)}"';

var header = 'content-disposition: form-data; name="${_browserEncode(entry.key)}"';
if (file.filename != null) {
header = '$header; filename="${_browserEncode(file.filename)}"';
}
header = '$header\r\n'
'content-type: ${file.contentType}';
return '$header\r\n\r\n';
}

Expand Down

0 comments on commit 2cc409e

Please sign in to comment.