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 to handle big file upload? #13

Open
devalexqt opened this issue May 28, 2020 · 5 comments
Open

How to handle big file upload? #13

devalexqt opened this issue May 28, 2020 · 5 comments
Assignees
Labels
help wanted Extra attention is needed

Comments

@devalexqt
Copy link

For express/node we have req stream pipe to file on disk, so do we have this option in deno?

@aaronwlee
Copy link
Owner

As far as I know, deno doesn't have the stream yet. I'm also looking for how to upload the file...
If you found the way, please let me know too.

@devalexqt
Copy link
Author

Now I'm searching...

@aaronwlee aaronwlee self-assigned this May 28, 2020
@aaronwlee aaronwlee added the help wanted Extra attention is needed label May 28, 2020
@devalexqt
Copy link
Author

Some info:
https://www.reddit.com/r/Deno/comments/ghiocq/is_there_a_way_to_handle_data_in_deno_by_using/

https://github.com/denoland/deno/blob/30702e2678200b6e21ba142347d2d213b86e9c6d/cli/tests/unit/streams_piping_test.ts

// Copyright 2018-2020 the Deno authors. All rights reserved. MIT license.
import { unitTest, assert, assertEquals } from "./test_util.ts";
import { assertThrowsAsync } from "../../../std/testing/asserts.ts";

unitTest(function streamPipeLocks() {
  const rs = new ReadableStream();
  const ws = new WritableStream();

  assertEquals(rs.locked, false);
  assertEquals(ws.locked, false);

  rs.pipeTo(ws);

  assert(rs.locked);
  assert(ws.locked);
});

@devalexqt
Copy link
Author

more info:
https://stackoverflow.com/questions/62019830/how-can-i-write-files-in-deno

var file = await Deno.open('./test.txt', { write: true, create: true })
//then somehow pipe req data to file
...

@devalexqt
Copy link
Author

denoland/deno#5996

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants