Skip to content
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

How can I speed limit when upload file #812

Closed
handloong opened this issue Feb 19, 2024 · 1 comment
Closed

How can I speed limit when upload file #812

handloong opened this issue Feb 19, 2024 · 1 comment

Comments

@handloong
Copy link

Flurl.Http : 4.0.2
Flurl : 4.0.2

I'm writing a utility that will be uploading files, and would like to provide the option to rate limit uploads. like max speed : 10M/s
Has anyone implemented something like this before?

private async void button1_Click(object sender, EventArgs e)
{

	var speed = 1024 * 1024;// 1M/s

	var fileStream = new FileStream(@"Large File", FileMode.Open);
	var response = await @"http://xxxxx:8000/upload"
		.PostMultipartAsync(content => content
		.AddFile("file", fileStream, "myfile.ios"))
		.ReceiveString();

	MessageBox.Show(response);
}
@tmenier
Copy link
Owner

tmenier commented Mar 24, 2024

Sounds like a programming question, I prefer people use Stack Overflow for that - more visibility and better odds of getting a good answer. I'd even start by searching on it, and frame it as an HttpClient question. I don't actually know the answer, never done anything like that.

@tmenier tmenier closed this as completed Mar 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants