jonataslaw / jonataslaw/get_server

File Upload some time get unreadable image

Open
#77 3 comments 0 reactions 0 assignees View on GitHub
Dominant language
Dart
Stars
484
Forks
43
PR merge metrics
No merged PRs in 30d

Description

import 'dart:io';

import 'package:get_server/get_server.dart';

class FileuploadView extends GetView {
@override
Widget build(BuildContext context) {
return MultiPartWidget(
builder: (context, upload) {
final path = 'images/123.jpg';
var p = File(path);
p.writeAsBytes(upload!.data);

return Json({
'nameFile': upload.name,
'mimeType': upload.mimeType,
'fileBase64': upload.data,
});
},
);
}
}

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.