-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
when upload a big file use multipart form, the memory grow fast and OOM(用multipart 方式上传文件,内存暴涨) #758
Comments
你内存能够读几个g.... |
我在模拟器上测试的,正常的话上传文件上分块读的。http库上传文件就不会内存爆掉 |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If this is still an issue, please make sure it is up to date and if so, add a comment that this is still an issue to keep it open. Thank you for your contributions. |
最后怎么解决的?我上传视频文件的时候也遇到out of memory报错了 |
這個有解決辦法嗎 ? |
dio version:3.0.0
test platform:simulator iPhone11 pro max(13.4)
flutter version:1.17
client code(dart ):
var dir=(await getApplicationDocumentsDirectory()).path;
final videoName = dir+'/OSX10.15.2.dmg';
final txtName = dir+'/file.txt';
// var imgFile = File(filename);
// Sending stream
var fm = FormData.fromMap({
'name': 'wendux',
'age': 25,
'file': MultipartFile.fromString('hellow world.'),
'files': [
await MultipartFile.fromFile(videoName,
filename: 'OSX10.15.2.dmg'),
MultipartFile.fromFileSync(txtName, filename: 'file.txt'),
]
});
).catchError(print);
server code(go):
package main
import (
"fmt"
"io"
"io/ioutil"
"net/http"
"os"
)
func uploadHandler(w http.ResponseWriter, r *http.Request) {
}
func main() {
http.HandleFunc("/upload", uploadHandler)
http.ListenAndServe(":8080", nil)
}
The text was updated successfully, but these errors were encountered: