-
-
Notifications
You must be signed in to change notification settings - Fork 349
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
Node.js sample doesn't work #17
Comments
Well yes, this is an old example and needs a good rewrite. Example could even be rewritten on other nodejs framework. |
i'm having a ton of issues with this too. i haven't found a good middleware to handle the multipart/formdata. suggestions? |
i made a pull request to fix this. i did not update the read.me in the pull.... maybe i'll make another. also! i'm having an issue assembling the binary from the blobs, if you're into stackoverflow points, you could answer my question (and the two other unanswered questions that are essentially the same question): http://stackoverflow.com/questions/23449065/reassemble-binary-after-flow-js-upload-on-node-express-server |
Reassembling all chunks is easy, just call this:
And that is it! But other question is, when this method should be called? But there is another issue with duplicate calls of Same approuch is done in php server side library: https://github.com/flowjs/flow-php-server/blob/master/src/Flow/File.php#L102 Hope this helps, and I hope someone could collaborate and update |
It worked for me (now that I'm on the right server). But there is no method for deleting. |
@chovy Any chance this solution could be added to the example? I'm trying to figure it out, I understand what is happening here, but I can't seem to produce the result. |
I decided not to use flow.js infavor of a custom handler. |
@AidasK Any chance you can provide a more complete answer with an example? It looks like you've been pasting the same solution in a number of places (stackoverflow), but don't really go into any depth to explain it. |
It isn't me posting in stackoverflow with this solution, somebody else is trying to earn some points. The reason, why I don't provide a normal nodejs solution, is because this sample is not written by me. And I hate how it looks https://github.com/flowjs/flow.js/blob/master/samples/Node.js/flow-node.js If you are just trying to play with flow.js or Nodejs is not neccessary, you should try php library instead: https://github.com/flowjs/flow-php-server |
@AidasK strange about the SO person.. what a lame thing to do.
|
This might work, but be careful with simultaneous uploads, because |
@AidasK You're right, i've only needed it for a single file. Thank you for the feedback. |
Hi @AidasK and @flashpunk, It would be really, really nice if we had a working example of flow-node.js . Thanks. |
@MilosStanic You can set the chunk directory by modifying these two lines in the example: https://github.com/flowjs/flow.js/blob/master/samples/Node.js/app.js#L1 and To store the resulting file in a custom directory, I've added var stream = fs.createWriteStream(UPLOAD_DIR + '/' + filename);
flow.write(identifier, stream); here: https://github.com/flowjs/flow.js/blob/master/samples/Node.js/app.js#L19 Does this answer your question? |
@powernap thanks, I solved my issues with Flow weeks ago. I don't really remember what I did. But I'm using Flow for my web app. And I like it. |
Hope that this implementation is helpful for you guys (re-write in ES6 & use Bluebird Promise) https://gist.github.com/ptgamr/4d1d07b770321a138c91 @AidasK Do you think it's good enough for a pull request? |
@ptgamr Looks awesome and clean. If you can, please update node.js sample with your code. I would be glad to accept it. |
First, the Readme is outdated. It says to do
npm install express
but this downloads express 4.0 now, but the code depends on express 3.x.So it should say
npm install [email protected]
until it is fixed for 4.x.Then the upload simply never finishes on the server side.
I actually first tried the node.js sample from resume.js and after it worked fine I tried to change the directory of the uploaded files and at this point point it did the same which the sample here does:
The line
POST done <filename>
doesn't appear on the server side log (onlypartly_done
for all the chunks), but on the browser side it saysfileSuccess FlowFile [...] complete
. The samples/Node.js/tmp directory remains empty.I haven't really tested more and I don't think I have much motivation right now to do it.
node v0.10.26
chromium Version 35.0.1916.17
The text was updated successfully, but these errors were encountered: